first
15
Sorce/.gitignore
vendored
Executable file
@@ -0,0 +1,15 @@
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
local.properties
|
||||
3
Sorce/.idea/.gitignore
generated
vendored
Executable file
@@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
1
Sorce/.idea/.name
generated
Executable file
@@ -0,0 +1 @@
|
||||
AlphaUnit
|
||||
6
Sorce/.idea/compiler.xml
generated
Executable file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="17" />
|
||||
</component>
|
||||
</project>
|
||||
20
Sorce/.idea/gradle.xml
generated
Executable file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="jbr-17" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
9
Sorce/.idea/misc.xml
generated
Executable file
@@ -0,0 +1,9 @@
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
||||
1
Sorce/app/.gitignore
vendored
Executable file
@@ -0,0 +1 @@
|
||||
/build
|
||||
43
Sorce/app/build.gradle
Executable file
@@ -0,0 +1,43 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.main.alphaunit'
|
||||
compileSdk 33
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.main.alphaunit"
|
||||
minSdk 33
|
||||
targetSdk 33
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.2.0-alpha01"
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'com.google.android.material:material:1.9.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.7.2'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.7.2'
|
||||
implementation("io.coil-kt:coil:2.4.0")
|
||||
implementation("com.squareup.okhttp3:okhttp:4.8.0")
|
||||
}
|
||||
21
Sorce/app/proguard-rules.pro
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.main.alphaunit;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||
assertEquals("com.main.alphaunit", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
39
Sorce/app/src/main/AndroidManifest.xml
Executable file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.AlphaUnit">
|
||||
<activity
|
||||
android:name=".PilotCreation"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".UnitListsSelection"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
|
||||
<meta-data
|
||||
android:name="android.app.lib_name"
|
||||
android:value="" />
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
476
Sorce/app/src/main/java/com/main/alphaunit/MainActivity.java
Executable file
@@ -0,0 +1,476 @@
|
||||
package com.main.alphaunit;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.appcompat.widget.SearchView.OnQueryTextListener;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.TimeInterpolator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.app.ActionBar;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.hardware.input.InputManager;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.os.CombinedVibration;
|
||||
import android.os.VibrationAttributes;
|
||||
import android.os.VibrationEffect;
|
||||
import android.os.Vibrator;
|
||||
import android.os.VibratorManager;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.SearchEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.view.animation.AccelerateInterpolator;
|
||||
import android.view.animation.AlphaAnimation;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.view.animation.DecelerateInterpolator;
|
||||
import android.view.animation.ScaleAnimation;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.main.alphaunit.UIComponents.UnitCardAnim;
|
||||
import com.main.alphaunit.bul.MULApi;
|
||||
import com.main.alphaunit.bul.MULClient;
|
||||
import com.main.alphaunit.bul.Unit;
|
||||
import com.main.alphaunit.bul.UnitLists;
|
||||
import com.main.alphaunit.bul.UnitListsManager;
|
||||
import com.main.alphaunit.bul.UnitOnUITouch;
|
||||
import com.main.alphaunit.bul.Unit_RecyclerViewAdapter;
|
||||
import com.main.alphaunit.bul.UserMasterUnitSelection;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.nio.channels.SelectionKey;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import coil.ImageLoader;
|
||||
import coil.request.ImageRequest;
|
||||
import okhttp3.ResponseBody;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
private TextView tv;
|
||||
private TextView pointValue;
|
||||
private TextView tonnage;
|
||||
private LinearLayout ll;
|
||||
private RecyclerView recyclerView;
|
||||
private SwipeRefreshLayout srl;
|
||||
private EditText Search;
|
||||
private Context con;
|
||||
private Unit_RecyclerViewAdapter adapter;
|
||||
private ImageView image;
|
||||
private VibratorManager vm;
|
||||
private Vibrator v;
|
||||
private LinearLayout BottomMenu;
|
||||
private Button SlideMenu;
|
||||
private RelativeLayout unitSRLContainer;
|
||||
private FrameLayout side_menu_container;
|
||||
private WebView mechWikiView;
|
||||
int imageResetHight;
|
||||
int currentHight;
|
||||
private boolean sideMenuOpen = true;
|
||||
private boolean donewithdata = false;
|
||||
private boolean isSavedUnitsSelected = false;
|
||||
|
||||
boolean isImageLarge = false;
|
||||
ArrayList<Unit> units = new ArrayList<>();
|
||||
ArrayList<Unit> SelectedUnits = new ArrayList<>();
|
||||
UnitLists selectedUnitList;
|
||||
ArrayList<UnitLists> unitLists = new ArrayList<>();
|
||||
int unitListsID = 0;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
tv = findViewById(R.id.Data);
|
||||
recyclerView = findViewById(R.id.RUnitView);
|
||||
srl = findViewById(R.id.unitsrl);
|
||||
Search = findViewById(R.id.UnitSearch);
|
||||
image = findViewById(R.id.UnitImageView);
|
||||
BottomMenu = findViewById(R.id.BottomMenu);
|
||||
unitSRLContainer = findViewById(R.id.unitsrlContiner);
|
||||
SlideMenu = findViewById(R.id.SlideMenu);
|
||||
mechWikiView = findViewById(R.id.mechWiki_View);
|
||||
pointValue = findViewById(R.id.Point_Value_TV);
|
||||
tonnage = findViewById(R.id.Tonnage_TV);
|
||||
//side_menu_container = findViewById(R.id.side_menue_container);
|
||||
con = this;
|
||||
|
||||
UnitListsManager.loadUnitLists(con);
|
||||
unitLists = UnitListsManager.unitsLists;
|
||||
UnitListsManager.unitsLists.size();
|
||||
if(UnitListsManager.unitsLists != null) {
|
||||
for (UnitLists list :
|
||||
UnitListsManager.unitsLists) {
|
||||
unitListsID ++;
|
||||
if (list.isSelected()) {
|
||||
selectedUnitList = list;
|
||||
if(selectedUnitList.getUnits()!= null) {
|
||||
SelectedUnits = selectedUnitList.getUnits();
|
||||
units = SelectedUnits;
|
||||
adapter = new Unit_RecyclerViewAdapter(con,SelectedUnits);
|
||||
recyclerView.setAdapter(adapter);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(con));
|
||||
//tv.setText("GOOD "+units.size());
|
||||
srl.setRefreshing(false);
|
||||
isSavedUnitsSelected = true;
|
||||
tv.setText("Not NULL!! " + list.getName());
|
||||
}else {
|
||||
tv.setText("NULL!!");
|
||||
}
|
||||
break;
|
||||
}
|
||||
tv.append(""+unitListsID);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
pointValue.setText(selectedUnitList.getPointCount()+"PV");
|
||||
tonnage.setText("Tonnage");
|
||||
|
||||
currentHight = (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 175f, getResources().getDisplayMetrics());
|
||||
imageResetHight = getResources().getDisplayMetrics().heightPixels;
|
||||
|
||||
float BottomViewResetPosition = recyclerView.getY();
|
||||
|
||||
ViewGroup.LayoutParams bottomMenuLayoutParams = BottomMenu.getLayoutParams();
|
||||
|
||||
BottomMenu.setMinimumHeight(currentHight);
|
||||
UnitCardAnim anim = new UnitCardAnim();
|
||||
|
||||
image.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
tv.setText("getY: " + BottomMenu.getY());
|
||||
if(!isImageLarge) {
|
||||
//BottomMenu.setLayoutParams(recyclerView.getLayoutParams());
|
||||
anim.imageFullScreen(UnitCardAnim.UnitCardState.fullScreen,BottomMenu,recyclerView);
|
||||
isImageLarge = true;
|
||||
} else if(isImageLarge) {
|
||||
//BottomMenu.setLayoutParams(bottomMenuLayoutParams);
|
||||
anim.imageFullScreen(UnitCardAnim.UnitCardState.bottomScreen,BottomMenu,recyclerView);
|
||||
isImageLarge = false;
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
vm = (VibratorManager) getSystemService(Context.VIBRATOR_MANAGER_SERVICE);
|
||||
v = vm.getDefaultVibrator();
|
||||
|
||||
SlideMenu.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
//SelectedUnits = UnitListsManager.getSelectedUnitList().getUnits();
|
||||
//UnitListsManager.getSelectedUnitList().setUnits(SelectedUnits);
|
||||
//UserMasterUnitSelection.loadMasterSelection(con);
|
||||
//units = UnitListsManager.getSelectedUnitList().getUnits();
|
||||
|
||||
if(selectedUnitList.getUnits() == null) {
|
||||
selectedUnitList.setUnits(SelectedUnits);
|
||||
}else {
|
||||
selectedUnitList.setUnits(SelectedUnits);
|
||||
SelectedUnits = (selectedUnitList.getUnits());
|
||||
}
|
||||
|
||||
|
||||
units = SelectedUnits;
|
||||
adapter = new Unit_RecyclerViewAdapter(con,SelectedUnits);
|
||||
recyclerView.setAdapter(adapter);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(con));
|
||||
//tv.setText("GOOD "+units.size());
|
||||
srl.setRefreshing(false);
|
||||
isSavedUnitsSelected = true;
|
||||
}
|
||||
});
|
||||
|
||||
SlideMenu.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View view) {
|
||||
UnitListsManager.unitsLists = unitLists;
|
||||
UnitListsManager.saveUnitLists(con);
|
||||
Intent i = new Intent(con, UnitListsSelection.class);
|
||||
startActivity(i);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
// This is click event for the recyclerview (the thing that has all the unitsUI stff)
|
||||
recyclerView.addOnItemTouchListener(new UnitOnUITouch(this, recyclerView, new UnitOnUITouch.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(View view, int position) {
|
||||
tv.setText("tuch: "+ position);
|
||||
MULClient.getUnitImage(image, units.get(position).id, 4, new MULClient.ImageViewLoad() {
|
||||
@Override
|
||||
public void onLoad(Response<ResponseBody> response, Bitmap bitmap) {
|
||||
v.vibrate(VibrationEffect.createPredefined(VibrationEffect.EFFECT_CLICK));
|
||||
anim.setState(UnitCardAnim.UnitCardState.Up);
|
||||
anim.cardInAndOutOfView(recyclerView,BottomMenu,image,imageResetHight);
|
||||
anim.getCurrentAnim().addListener(new Animator.AnimatorListener() {
|
||||
@Override
|
||||
public void onAnimationStart(@NonNull Animator animator) {}
|
||||
@Override
|
||||
public void onAnimationEnd(@NonNull Animator animator) {
|
||||
image.setImageBitmap(bitmap);
|
||||
anim.loadUnitWiki(mechWikiView, units.get(position).mechClass);
|
||||
anim.cardInAndOutOfView(recyclerView,BottomMenu,image,imageResetHight);
|
||||
}
|
||||
@Override
|
||||
public void onAnimationCancel(@NonNull Animator animator) {}
|
||||
@Override
|
||||
public void onAnimationRepeat(@NonNull Animator animator) {}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
public void onFail(Throwable throwable) {
|
||||
|
||||
v.vibrate(VibrationEffect.createWaveform(new long[] {150,150,40},new int[] {120,00,100},-1));
|
||||
anim.setState(UnitCardAnim.UnitCardState.Down);
|
||||
anim.cardInAndOutOfView(recyclerView,BottomMenu,image, imageResetHight);
|
||||
}
|
||||
});
|
||||
CardView cv = view.findViewById(R.id.MyCard);
|
||||
Animation animation = AnimationUtils.loadAnimation(getApplicationContext(),R.anim.blink);
|
||||
cv.startAnimation(animation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLongItemClick(View view, int position) {
|
||||
tv.setText("Long tuch: " + position);
|
||||
if(!isSavedUnitsSelected) {
|
||||
|
||||
SelectedUnits.add(units.get(position));
|
||||
v.vibrate(VibrationEffect.createPredefined(VibrationEffect.EFFECT_DOUBLE_CLICK));
|
||||
CardView cv = view.findViewById(R.id.MyCard);
|
||||
Animation animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.blink);
|
||||
cv.startAnimation(animation);
|
||||
} else {
|
||||
SelectedUnits.remove(position);
|
||||
units = SelectedUnits;
|
||||
v.vibrate(VibrationEffect.createPredefined(VibrationEffect.EFFECT_DOUBLE_CLICK));
|
||||
CardView cv = view.findViewById(R.id.MyCard);
|
||||
Animation animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.blink);
|
||||
cv.startAnimation(animation);
|
||||
adapter = new Unit_RecyclerViewAdapter(con,SelectedUnits);
|
||||
recyclerView.setAdapter(adapter);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(con));
|
||||
}
|
||||
|
||||
pointValue.setText(selectedUnitList.getPointCount()+"PV");
|
||||
tonnage.setText("Tonnage");
|
||||
UnitListsManager.unitsLists = unitLists;
|
||||
UnitListsManager.saveUnitLists(con);
|
||||
|
||||
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
Search.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||
@Override
|
||||
public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
|
||||
if(i == EditorInfo.IME_ACTION_SEARCH && Search.getText().length() > 2) {
|
||||
Search.clearFocus();
|
||||
InputMethodManager in = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
in.hideSoftInputFromWindow(Search.getWindowToken(),0);
|
||||
srl.setRefreshing(true);
|
||||
|
||||
isSavedUnitsSelected = false;
|
||||
getData(Search.getText().toString());
|
||||
}else {
|
||||
|
||||
Search.clearFocus();
|
||||
InputMethodManager in = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
in.hideSoftInputFromWindow(Search.getWindowToken(),0);
|
||||
srl.setRefreshing(false);
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
srl.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
|
||||
isSavedUnitsSelected = false;
|
||||
srl.setRefreshing(true);
|
||||
//getData(Search.getText().toString());
|
||||
SelectedUnits = selectedUnitList.getUnits();
|
||||
units = SelectedUnits;
|
||||
adapter = new Unit_RecyclerViewAdapter(con,SelectedUnits);
|
||||
recyclerView.setAdapter(adapter);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(con));
|
||||
//tv.setText("GOOD "+units.size());
|
||||
srl.setRefreshing(false);
|
||||
isSavedUnitsSelected = true;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void Dommy() {
|
||||
Unit unit = new Unit();
|
||||
for (int i = 0; i < 10; i++) {
|
||||
units.add(new Unit());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Gets the image for the units
|
||||
private void getImage(int id, int skill) {
|
||||
Call<ResponseBody> call = MULClient.getInstance().getMULApi().getMechImage(Integer.toString(id), skill);
|
||||
//byte[] bytes;
|
||||
|
||||
call.enqueue(new Callback<ResponseBody>() {
|
||||
@Override
|
||||
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
|
||||
image.setImageBitmap(BitmapFactory.decodeStream(response.body().byteStream()));
|
||||
ValueAnimator UnitRecycalViewScaileDownAnim = ValueAnimator.ofInt(0,700);
|
||||
UnitRecycalViewScaileDownAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
@Override
|
||||
public void onAnimationUpdate(@NonNull ValueAnimator valueAnimator) {
|
||||
recyclerView.setPadding(0,0,0,(Integer) valueAnimator.getAnimatedValue());
|
||||
}
|
||||
});
|
||||
UnitRecycalViewScaileDownAnim.setInterpolator(new DecelerateInterpolator(2));
|
||||
UnitRecycalViewScaileDownAnim.start();
|
||||
|
||||
BottomMenu.setAlpha(1.0f);
|
||||
|
||||
ValueAnimator BottomViewUpAnim = ValueAnimator.ofFloat(imageResetHight,imageResetHight-700);
|
||||
BottomViewUpAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
@Override
|
||||
public void onAnimationUpdate(@NonNull ValueAnimator valueAnimator) {
|
||||
BottomMenu.setY((Float) valueAnimator.getAnimatedValue());
|
||||
}
|
||||
});
|
||||
BottomViewUpAnim.setInterpolator(new DecelerateInterpolator(2));
|
||||
BottomViewUpAnim.start();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ResponseBody> call, Throwable t) {
|
||||
//tv.setText("Image did not work");
|
||||
//v.vibrate(VibrationEffect.createWaveform(new long[] {150,150,40},new int[] {120,00,100},-1));
|
||||
|
||||
//BottomMenu.setAlpha(0.0f);
|
||||
}
|
||||
});
|
||||
tv.setText("Done");
|
||||
}
|
||||
|
||||
private void getData(String Search) {
|
||||
Call<JsonObject> call = MULClient.getInstance().getMULApi().getMechs(Search);
|
||||
|
||||
call.enqueue(new Callback<JsonObject>() {
|
||||
@Override
|
||||
public void onResponse(Call<JsonObject> call, Response<JsonObject> response) {
|
||||
JsonObject jo = response.body();
|
||||
JsonArray UnitList;
|
||||
|
||||
if(!jo.get("Units").isJsonNull()) {
|
||||
units = new ArrayList<Unit>();
|
||||
UnitList = jo.get("Units").getAsJsonArray();
|
||||
Unit tmp = new Unit();
|
||||
for (int i = 0; i < jo.get("Units").getAsJsonArray().size(); i++) {
|
||||
units.add(new Unit());
|
||||
//units.get(0).mechClass = response.body().getAsJsonObject().get("Unit").getAsString();
|
||||
if (!UnitList.get(i).getAsJsonObject().get("Id").isJsonNull())
|
||||
units.get(i).id = UnitList.get(i).getAsJsonObject().get("Id").getAsInt();
|
||||
if (!UnitList.get(i).getAsJsonObject().get("BFArmor").isJsonNull())
|
||||
units.get(i).armor= UnitList.get(i).getAsJsonObject().get("BFArmor").getAsInt();
|
||||
if (!UnitList.get(i).getAsJsonObject().get("BFStructure").isJsonNull())
|
||||
units.get(i).structure = UnitList.get(i).getAsJsonObject().get("BFStructure").getAsInt();
|
||||
if (!UnitList.get(i).getAsJsonObject().get("BFOverheat").isJsonNull())
|
||||
units.get(i).overheat = UnitList.get(i).getAsJsonObject().get("BFOverheat").getAsInt();
|
||||
if (!UnitList.get(i).getAsJsonObject().get("BFDamageShort").isJsonNull())
|
||||
units.get(i).damageShort = UnitList.get(i).getAsJsonObject().get("BFDamageShort").getAsInt();
|
||||
if (!UnitList.get(i).getAsJsonObject().get("BFDamageMedium").isJsonNull())
|
||||
units.get(i).damageMedium = UnitList.get(i).getAsJsonObject().get("BFDamageMedium").getAsInt();
|
||||
if (!UnitList.get(i).getAsJsonObject().get("BFDamageLong").isJsonNull())
|
||||
units.get(i).damageLong = UnitList.get(i).getAsJsonObject().get("BFDamageLong").getAsInt();
|
||||
if (!UnitList.get(i).getAsJsonObject().get("BFDamageExtreme").isJsonNull())
|
||||
units.get(i).damageExtreme = UnitList.get(i).getAsJsonObject().get("BFDamageExtreme").getAsInt();
|
||||
if (!UnitList.get(i).getAsJsonObject().get("BFPointValue").isJsonNull())
|
||||
units.get(i).baseBP = UnitList.get(i).getAsJsonObject().get("BFPointValue").getAsInt();
|
||||
if (!UnitList.get(i).getAsJsonObject().get("Tonnage").isJsonNull())
|
||||
units.get(i).tonnage = UnitList.get(i).getAsJsonObject().get("Tonnage").getAsInt();
|
||||
if (!UnitList.get(i).getAsJsonObject().get("BFTMM").isJsonNull())
|
||||
units.get(i).tmm = UnitList.get(i).getAsJsonObject().get("BFTMM").getAsInt();
|
||||
if (!UnitList.get(i).getAsJsonObject().get("Class").isJsonNull())
|
||||
units.get(i).mechClass = UnitList.get(i).getAsJsonObject().get("Class").getAsString();
|
||||
if (!UnitList.get(i).getAsJsonObject().get("Variant").isJsonNull())
|
||||
units.get(i).mechVariant = UnitList.get(i).getAsJsonObject().get("Variant").toString();
|
||||
if(!UnitList.get(i).getAsJsonObject().get("Role").getAsJsonObject().get("Name").isJsonNull())
|
||||
units.get(i).role = UnitList.get(i).getAsJsonObject().get("Role").getAsJsonObject().get("Name").getAsString();
|
||||
if(!UnitList.get(i).getAsJsonObject().get("Technology").getAsJsonObject().get("Name").isJsonNull())
|
||||
units.get(i).technology = UnitList.get(i).getAsJsonObject().get("Technology").getAsJsonObject().get("Name").getAsString();
|
||||
units.get(i).movement = UnitList.get(i).getAsJsonObject().get("BFMove").getAsString();
|
||||
if (!UnitList.get(i).getAsJsonObject().get("BFAbilities").isJsonNull())
|
||||
units.get(i).Abilities = UnitList.get(i).getAsJsonObject().get("BFAbilities").getAsString();
|
||||
|
||||
}
|
||||
donewithdata = true;
|
||||
|
||||
adapter = new Unit_RecyclerViewAdapter(con,units);
|
||||
recyclerView.setAdapter(adapter);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(con));
|
||||
tv.setText("GOOD "+units.size());
|
||||
srl.setRefreshing(false);
|
||||
} else {
|
||||
|
||||
tv.setText("NOT GOOD");
|
||||
srl.setRefreshing(false);
|
||||
}
|
||||
donewithdata = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<JsonObject> call, Throwable t) {
|
||||
tv.setText("This was not working\n" + t.toString());
|
||||
|
||||
donewithdata = true;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.main.alphaunit;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
public class PilotCreation extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_pilot_creation);
|
||||
}
|
||||
}
|
||||
210
Sorce/app/src/main/java/com/main/alphaunit/UIComponents/UnitCardAnim.java
Executable file
@@ -0,0 +1,210 @@
|
||||
package com.main.alphaunit.UIComponents;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.net.Uri;
|
||||
import android.view.View;
|
||||
import android.view.animation.AccelerateInterpolator;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.DecelerateInterpolator;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
public class UnitCardAnim {
|
||||
|
||||
private UnitCardState currentState;
|
||||
private boolean swipe = false;
|
||||
private boolean swipeOut = true;
|
||||
private boolean swipeIn = false;
|
||||
private boolean isUp = false;
|
||||
|
||||
private Animator currentAnim;
|
||||
public enum UnitCardState {
|
||||
Up,
|
||||
Down,
|
||||
fullScreen,
|
||||
bottomScreen,
|
||||
}
|
||||
|
||||
public UnitCardState getState() {return currentState;}
|
||||
public Animator getCurrentAnim() {return currentAnim;}
|
||||
|
||||
public void loadUnitWiki(WebView webview, String mechClass){
|
||||
webview.setWebViewClient(new WebViewClient() {
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
view.loadUrl(url);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
webview.loadUrl("https://www.sarna.net/wiki/"+mechClass);
|
||||
}
|
||||
|
||||
// Swipe image left and right
|
||||
private void swipeImage(View image) {
|
||||
|
||||
if(swipeOut) {
|
||||
swipeOut = false;
|
||||
ValueAnimator SwipeLeft = ValueAnimator.ofFloat(0, -1000);
|
||||
SwipeLeft.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
@Override
|
||||
public void onAnimationUpdate(@NonNull ValueAnimator valueAnimator) {
|
||||
image.setTranslationX((Float) valueAnimator.getAnimatedValue());
|
||||
}
|
||||
});
|
||||
SwipeLeft.setInterpolator(new AccelerateInterpolator(5f));
|
||||
SwipeLeft.setDuration(200);
|
||||
SwipeLeft.start();
|
||||
swipeIn = true;
|
||||
currentAnim = SwipeLeft;
|
||||
}
|
||||
else if(swipeIn) {
|
||||
swipeIn = false;
|
||||
ValueAnimator SwipeRight = ValueAnimator.ofFloat(-1000, 0);
|
||||
SwipeRight.setStartDelay(300);
|
||||
SwipeRight.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
@Override
|
||||
public void onAnimationUpdate(@NonNull ValueAnimator valueAnimator) {
|
||||
image.setTranslationX((Float) valueAnimator.getAnimatedValue());
|
||||
}
|
||||
});
|
||||
SwipeRight.setInterpolator(new DecelerateInterpolator(5f));
|
||||
SwipeRight.setDuration(200);
|
||||
SwipeRight.start();
|
||||
swipeOut = true;
|
||||
currentAnim = SwipeRight;
|
||||
}
|
||||
}
|
||||
public void setState(UnitCardState state) { if(currentState == UnitCardState.Up && state == currentState) { swipe = true;} currentState = state;}
|
||||
public void cardInAndOutOfView(RecyclerView rv, View card, View image, int startingPosition) {
|
||||
|
||||
// If the card is down and is out of screen bring it up
|
||||
if(currentState == UnitCardState.Up && !swipe && !isUp) {
|
||||
|
||||
ValueAnimator UnitRecycalViewScaileDownAnim = ValueAnimator.ofInt(0, 850);
|
||||
UnitRecycalViewScaileDownAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
@Override
|
||||
public void onAnimationUpdate(@NonNull ValueAnimator valueAnimator) {
|
||||
rv.setTranslationY(-(Integer) valueAnimator.getAnimatedValue());
|
||||
rv.setPadding(0, (Integer) valueAnimator.getAnimatedValue(),0,0);
|
||||
}
|
||||
});
|
||||
UnitRecycalViewScaileDownAnim.setInterpolator(new DecelerateInterpolator(2));
|
||||
UnitRecycalViewScaileDownAnim.start();
|
||||
|
||||
card.setAlpha(1.0f);
|
||||
|
||||
ValueAnimator BottomViewUpAnim = ValueAnimator.ofFloat(startingPosition,startingPosition -850);
|
||||
BottomViewUpAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
@Override
|
||||
public void onAnimationUpdate(@NonNull ValueAnimator valueAnimator) {
|
||||
card.setY((Float) valueAnimator.getAnimatedValue());
|
||||
}
|
||||
});
|
||||
BottomViewUpAnim.setInterpolator(new DecelerateInterpolator(2));
|
||||
BottomViewUpAnim.start();
|
||||
|
||||
currentAnim = BottomViewUpAnim;
|
||||
isUp = true;
|
||||
|
||||
}
|
||||
// If The card is in view bring it down
|
||||
else if (currentState == UnitCardState.Down && isUp) {
|
||||
ValueAnimator UnitRecycalViewScaileDownAnim = ValueAnimator.ofInt(850, 0);
|
||||
UnitRecycalViewScaileDownAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
@Override
|
||||
public void onAnimationUpdate(@NonNull ValueAnimator valueAnimator) {
|
||||
rv.setTranslationY( -(Integer) valueAnimator.getAnimatedValue());
|
||||
rv.setPadding(0, (Integer) valueAnimator.getAnimatedValue(),0,0);
|
||||
}
|
||||
});
|
||||
UnitRecycalViewScaileDownAnim.setInterpolator(new AccelerateInterpolator(2f));
|
||||
UnitRecycalViewScaileDownAnim.start();
|
||||
|
||||
card.setAlpha(1.0f);
|
||||
|
||||
ValueAnimator BottomViewUpAnim = ValueAnimator.ofFloat(startingPosition-850, startingPosition+500);
|
||||
BottomViewUpAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
@Override
|
||||
public void onAnimationUpdate(@NonNull ValueAnimator valueAnimator) {
|
||||
card.setY((Float) valueAnimator.getAnimatedValue());
|
||||
}
|
||||
});
|
||||
BottomViewUpAnim.setInterpolator(new AccelerateInterpolator(2f));
|
||||
BottomViewUpAnim.start();
|
||||
currentAnim = BottomViewUpAnim;
|
||||
isUp = false;
|
||||
swipe = false;
|
||||
}
|
||||
// if the card is up move the image back and forth
|
||||
else if(currentState == UnitCardState.Up && swipe && isUp) {
|
||||
|
||||
swipeImage(image);
|
||||
}
|
||||
}
|
||||
|
||||
public void imageFullScreen(UnitCardState state,View imageContainer, RecyclerView recycalView) {
|
||||
|
||||
if(state == UnitCardState.fullScreen) {
|
||||
float firstPosition = recycalView.getY();
|
||||
ValueAnimator recycalViewShrink = ValueAnimator.ofInt(850, 2500);
|
||||
ValueAnimator imageContainerMoveUp = ValueAnimator.ofInt(850, 2500);
|
||||
recycalViewShrink.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
@Override
|
||||
public void onAnimationUpdate(@NonNull ValueAnimator valueAnimator) {
|
||||
imageContainer.setPadding(-10,-10,-10,-10);
|
||||
recycalView.setTranslationY(-(Integer) valueAnimator.getAnimatedValue());
|
||||
recycalView.setPadding(0, (Integer) valueAnimator.getAnimatedValue(), 0, 0);
|
||||
}
|
||||
});
|
||||
recycalViewShrink.setDuration(500);
|
||||
recycalViewShrink.setInterpolator(new AccelerateInterpolator(2));
|
||||
|
||||
imageContainerMoveUp.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
@Override
|
||||
public void onAnimationUpdate(@NonNull ValueAnimator valueAnimator) {
|
||||
imageContainer.setTranslationY(-(Integer) valueAnimator.getAnimatedValue());
|
||||
}
|
||||
});
|
||||
imageContainerMoveUp.setInterpolator(new AccelerateInterpolator(2));
|
||||
imageContainerMoveUp.setDuration(500);
|
||||
|
||||
|
||||
|
||||
imageContainerMoveUp.start();
|
||||
recycalViewShrink.start();
|
||||
|
||||
} else if(state == UnitCardState.bottomScreen){
|
||||
|
||||
float firstPosition = recycalView.getY();
|
||||
ValueAnimator recycalViewShrink = ValueAnimator.ofInt(2500,850 );
|
||||
ValueAnimator imageContainerMoveUp = ValueAnimator.ofInt(2500, 850);
|
||||
recycalViewShrink.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
@Override
|
||||
public void onAnimationUpdate(@NonNull ValueAnimator valueAnimator) {
|
||||
recycalView.setTranslationY(-(Integer) valueAnimator.getAnimatedValue());
|
||||
recycalView.setPadding(0, (Integer) valueAnimator.getAnimatedValue(), 0, 0);
|
||||
}
|
||||
});
|
||||
recycalViewShrink.setDuration(500);
|
||||
recycalViewShrink.setInterpolator(new AccelerateInterpolator(2));
|
||||
|
||||
imageContainerMoveUp.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
@Override
|
||||
public void onAnimationUpdate(@NonNull ValueAnimator valueAnimator) {
|
||||
imageContainer.setTranslationY(-(Integer) valueAnimator.getAnimatedValue());
|
||||
}
|
||||
});
|
||||
imageContainerMoveUp.setInterpolator(new AccelerateInterpolator(2));
|
||||
imageContainerMoveUp.setDuration(500);
|
||||
imageContainerMoveUp.start();
|
||||
recycalViewShrink.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
119
Sorce/app/src/main/java/com/main/alphaunit/UnitListsSelection.java
Executable file
@@ -0,0 +1,119 @@
|
||||
package com.main.alphaunit;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.main.alphaunit.bul.UnitLists;
|
||||
import com.main.alphaunit.bul.UnitListsManager;
|
||||
import com.main.alphaunit.bul.UnitLists_RecyclerViewAdapter;
|
||||
import com.main.alphaunit.bul.UnitOnUITouch;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class UnitListsSelection extends AppCompatActivity {
|
||||
|
||||
private RecyclerView unitListsRecyclerView;
|
||||
private UnitLists_RecyclerViewAdapter adapter;
|
||||
|
||||
private EditText listNameIn;
|
||||
private EditText listDescriptionIn;
|
||||
private TextView dbugView;
|
||||
|
||||
private Button backToMainActivity;
|
||||
private Button addUnitList;
|
||||
|
||||
UnitLists selectedUnitList;
|
||||
private ArrayList<UnitLists> unitLists;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_unit_lists_selection);
|
||||
Context con = this;
|
||||
|
||||
unitListsRecyclerView = findViewById(R.id.UnitListRecyclerView);
|
||||
backToMainActivity = findViewById(R.id.BackToMainActivity);
|
||||
addUnitList = findViewById(R.id.AddUnitList);
|
||||
listNameIn = findViewById(R.id.unitListNameIn);
|
||||
listDescriptionIn = findViewById(R.id.UnitDescriptionIn);
|
||||
dbugView = findViewById(R.id.dbug);
|
||||
unitLists = new ArrayList<>();
|
||||
|
||||
|
||||
UnitListsManager.loadUnitLists(con);
|
||||
UnitListsManager.unitsLists.size();
|
||||
unitLists = UnitListsManager.unitsLists;
|
||||
adapter = new UnitLists_RecyclerViewAdapter(con, unitLists);
|
||||
unitListsRecyclerView.setAdapter(new UnitLists_RecyclerViewAdapter(con,unitLists));
|
||||
unitListsRecyclerView.setLayoutManager(new LinearLayoutManager(con));
|
||||
|
||||
|
||||
for (int i = 0; i < unitLists.size(); i++) {
|
||||
if(unitLists.get(i).isSelected()){
|
||||
selectedUnitList = unitLists.get(i);
|
||||
dbugView.setText(""+ unitLists.get(i).getName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
unitListsRecyclerView.addOnItemTouchListener(new UnitOnUITouch(this, unitListsRecyclerView, new UnitOnUITouch.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(View view, int position) {
|
||||
if(selectedUnitList != null) {
|
||||
selectedUnitList.deselect();
|
||||
}
|
||||
selectedUnitList = unitLists.get(position);
|
||||
selectedUnitList.select();
|
||||
Animation animation = AnimationUtils.loadAnimation(getApplicationContext(),R.anim.blink);
|
||||
view.findViewById(R.id.UnitListName).startAnimation(animation);
|
||||
UnitListsManager.saveUnitLists(con);
|
||||
Intent i = new Intent(con, MainActivity.class);
|
||||
startActivity(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLongItemClick(View view, int position) {
|
||||
unitLists.remove(position);
|
||||
UnitListsManager.unitsLists = unitLists;
|
||||
UnitListsManager.saveUnitLists(con);
|
||||
adapter = new UnitLists_RecyclerViewAdapter(con, unitLists);
|
||||
unitListsRecyclerView.setAdapter(new UnitLists_RecyclerViewAdapter(con,unitLists));
|
||||
unitListsRecyclerView.setLayoutManager(new LinearLayoutManager(con));
|
||||
}
|
||||
}));
|
||||
|
||||
addUnitList.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
unitLists.add(new UnitLists(listNameIn.getText().toString(), listDescriptionIn.getText().toString()));
|
||||
UnitListsManager.unitsLists = unitLists;
|
||||
UnitListsManager.saveUnitLists(con);
|
||||
adapter = new UnitLists_RecyclerViewAdapter(con, unitLists);
|
||||
unitListsRecyclerView.setAdapter(new UnitLists_RecyclerViewAdapter(con,unitLists));
|
||||
unitListsRecyclerView.setLayoutManager(new LinearLayoutManager(con));
|
||||
UnitListsManager.unitsLists = unitLists;
|
||||
UnitListsManager.saveUnitLists(con);
|
||||
}
|
||||
});
|
||||
|
||||
backToMainActivity.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
UnitListsManager.saveUnitLists(con);
|
||||
Intent i = new Intent(con, MainActivity.class);
|
||||
startActivity(i);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.main.alphaunit.bul;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class AbilityIndex {
|
||||
public class Ability{
|
||||
String name;
|
||||
String definition;
|
||||
|
||||
public Ability(String abilityName, String abilityDefinition) {
|
||||
name = abilityName;
|
||||
definition = abilityDefinition;
|
||||
setIndex();
|
||||
}
|
||||
|
||||
public String getDefinition() {
|
||||
return definition;
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
String unitAbilities;
|
||||
ArrayList<Ability> index = new ArrayList<>();
|
||||
private void setIndex() {
|
||||
index.clear();
|
||||
index.add(new Ability("ADVANCED FIRE CONTROL:AFC","Industrial-Mechs and support vehicles equipped with Advanced Fire Control do not suffer Target Number modifiers for their unit type."));
|
||||
index.add(new Ability("AMPHIBIOUS:AMP","THis ability makes a non-naval unit capable of water movement. Amphibious units play a total of 4'' per inch of water traversed and move as a surface naval unit in water, except that they freely move in and out of water areas."));
|
||||
index.add(new Ability("ANGEL ECM:AECM", "An angel ECM suite has the effects of standard ECM (see p.77) but is treated two standard ECM suites if using the ECM/ECCM optional rule (see p. 161)."));
|
||||
index.add(new Ability("ANTI-MECH:AM", "Infantry units with the Anti-Mech (AM) special ability can make a special attack against any ground units, landed VTOLs and WiGEs, or grounded aerospace units with which they are in base-to-base contact. Anti-Mech Infantry attacks are treated as a physical attack (see p. 45)."));
|
||||
index.add(new Ability("ANTI-MISSILE SYSTEM:AMS", "A unit with an AMS reduces the damage by 1 point (to a minimum of 1) from any of the following attacks: standard weapon attack from a unit with the IF, SRM, or LRM special abilities, Indirect Fire attack uning the IF special ability, or special weapon attack make using the SRM or LRM special abilties, AMS only works on attacks coming in the front arc, unless mounted in a turret (TUR)."));
|
||||
index.add(new Ability("ARMORED COMPONENTS:ARM", "A unit with this ability ignores the first critical hit chance rolled against it during a single Alpha Strike scenario. The first time circumstances arise that would normally generate on opportunity for a critical hit (such as structure damage), the unit's controlling player must strike off this ability as 'spent' for the remainder of the scenario, and the attacker loses his first opportunity to roll for a critical hit"));
|
||||
index.add(new Ability("ARMORED MOTIVE SYSTEMS:ARS", "A unit with this special ability applies a -1 modifier on the Determining Motive Systems Damage roll (see Motive Systems Damage Table, p. 50)."));
|
||||
index.add(new Ability("BARRIER ARMOR RATING:BAR", "The BAR special indicates a unit that is protected by substandard armor (or commerialpgrade armor). Successful attacks against such units always trigger a roll for critical hits, regardless of whether or not the structure is damaged."));
|
||||
index.add(new Ability("BASIC FIRE CONTOL:BFC", "A support vehicle or IndustrialMech with this ability has an inferior targeting and tracking system, which adds a Target Number modifier of +1 for its attack. (This modifier is listed in the Attack Modifiers Table, see p. 44.)"));
|
||||
index.add(new Ability("BATTLEMECH HARJEL:BHJ","a Mech protected by HarJel ignores the additional 'hull breach' critical hit checks required for being attacked while underwater or in a vacuum. All other causes for critical hit rolls still apply as normal."));
|
||||
index.add(new Ability("BATTLEMECH SHIELD:SHLD", "Shield-bearing Mechs gain some protection against weapon and physical attacks at the expense of their own attack accuracy. To reflect this, shield-equipped units reduce the damage from most weapons and physical attacks by 1 point (to a minimum of 0). Indirect attacks, heat-causing attacks, and area-effect attacks (such as artillery and bombs) are not dampened by the shield and thus deliver full damage. All weapon attacks made by a Mech with this ability incur an additional +1 Target Number modifier."));
|
||||
index.add(new Ability("BOMB:BOMB#", "Conventional and aerospace fighters, fixed-wing support vehicles, and some battle armor can carry bombs. The number of Bombs these units can carr are equal to the number in the ability's notation (so a unit with BOMB4 carries up to 4 bombs). For most units, these bombs may be of any type, through battle armor units with this ability may only use cluster bombs (see p 183). (As a special exception, Arrow IV bombs must count the first Arrow IV missile carried this way as 2 bombs. All remaining bombs are then counted normally.) Each bomb a unit carries reduces its Thrust value by 1 (Battle armor units with bombs suffer no effects on their Move ratings.) A bomb-carrying unit's card should list how many bombs the unit is carrying in the scenario, which must be equal to or less than the number this ability enables it to carry. "));
|
||||
}
|
||||
private ArrayList<Ability> unitAbilityParser(String unitAbilities) {
|
||||
return null;
|
||||
}
|
||||
public ArrayList<Ability> getUnitAbilityDefinitions(String unitAbilities) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
39
Sorce/app/src/main/java/com/main/alphaunit/bul/Bul.java
Executable file
@@ -0,0 +1,39 @@
|
||||
package com.main.alphaunit.bul;
|
||||
|
||||
|
||||
import android.os.AsyncTask;
|
||||
|
||||
import androidx.loader.content.AsyncTaskLoader;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
|
||||
public class Bul {
|
||||
private List<Unit> units;
|
||||
static String data;
|
||||
public static String Get(String name) {
|
||||
try {
|
||||
URL urlForGetRequest = new URL("https://masterunitlist.azurewebsites.net/Unit/Filter?Types=18");
|
||||
OkHttpClient client = new OkHttpClient();
|
||||
Request request = new Request.Builder()
|
||||
.url(urlForGetRequest)
|
||||
.build();
|
||||
|
||||
try (Response response = client.newCall(request).execute()) {
|
||||
return response.body().string();
|
||||
}
|
||||
}catch (Exception e) {
|
||||
|
||||
return e.toString();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
25
Sorce/app/src/main/java/com/main/alphaunit/bul/MULApi.java
Executable file
@@ -0,0 +1,25 @@
|
||||
package com.main.alphaunit.bul;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import okhttp3.ResponseBody;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Path;
|
||||
import retrofit2.http.Query;
|
||||
import retrofit2.http.Url;
|
||||
|
||||
public interface MULApi {
|
||||
String BaseURL = "https://masterunitlist.azurewebsites.net/";
|
||||
String test = "Atlas";
|
||||
|
||||
@GET("Unit/QuickList")
|
||||
Call<JsonObject> getMechs(@Query(value = "Name",encoded = true) String id);
|
||||
|
||||
@GET("Unit/Card/{id}")
|
||||
Call<ResponseBody> getMechImage(@Path(value = "id", encoded = true) String id, @Query(value = "skill",encoded = true) int skill);
|
||||
}
|
||||
60
Sorce/app/src/main/java/com/main/alphaunit/bul/MULClient.java
Executable file
@@ -0,0 +1,60 @@
|
||||
package com.main.alphaunit.bul;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.media.Image;
|
||||
import android.view.animation.Animation;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import okhttp3.ResponseBody;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
import retrofit2.Retrofit;
|
||||
import retrofit2.converter.gson.GsonConverterFactory;
|
||||
|
||||
public class MULClient {
|
||||
private static MULClient instance = null;
|
||||
private MULApi api;
|
||||
|
||||
public interface ImageViewLoad {
|
||||
void onLoad(Response<ResponseBody> response, Bitmap bitmap);
|
||||
void onFail(Throwable throwable);
|
||||
}
|
||||
|
||||
private MULClient() {
|
||||
Retrofit retrofit = new Retrofit.Builder().baseUrl(api.BaseURL)
|
||||
.addConverterFactory(GsonConverterFactory.create())
|
||||
.build();
|
||||
api = retrofit.create(MULApi.class);
|
||||
}
|
||||
|
||||
public static synchronized MULClient getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new MULClient();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static void getUnitImage(ImageView imageview, int id, int skill, ImageViewLoad imageViewLoad) {
|
||||
|
||||
Call<ResponseBody> call =getInstance().getMULApi().getMechImage(Integer.toString(id), skill);
|
||||
call.enqueue(new Callback<ResponseBody>() {
|
||||
@Override
|
||||
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
|
||||
Bitmap bitmap = BitmapFactory.decodeStream(response.body().byteStream());
|
||||
imageViewLoad.onLoad(response, bitmap);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<ResponseBody> call, Throwable t) {
|
||||
imageViewLoad.onFail(t);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
public MULApi getMULApi() {
|
||||
return api;
|
||||
}
|
||||
}
|
||||
6
Sorce/app/src/main/java/com/main/alphaunit/bul/MULData.java
Executable file
@@ -0,0 +1,6 @@
|
||||
package com.main.alphaunit.bul;
|
||||
|
||||
public class MULData {
|
||||
private String mechClass;
|
||||
private String mechVarent;
|
||||
}
|
||||
8
Sorce/app/src/main/java/com/main/alphaunit/bul/Pilot.java
Executable file
@@ -0,0 +1,8 @@
|
||||
package com.main.alphaunit.bul;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Pilot implements Serializable {
|
||||
public int skill = 4;
|
||||
public String name = "None";
|
||||
}
|
||||
122
Sorce/app/src/main/java/com/main/alphaunit/bul/Unit.java
Executable file
@@ -0,0 +1,122 @@
|
||||
package com.main.alphaunit.bul;
|
||||
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Unit implements Serializable {
|
||||
public int id;
|
||||
public int armor;
|
||||
public int structure;
|
||||
public int overheat;
|
||||
public int damageShort, damageMedium, damageLong, damageExtreme;
|
||||
public int baseBP;
|
||||
public int tonnage;
|
||||
public int tmm;
|
||||
public Pilot pilot;
|
||||
public String mechClass;
|
||||
public String mechVariant;
|
||||
public String role;
|
||||
public String Abilities;
|
||||
public String movement;
|
||||
public String technology;
|
||||
|
||||
public Unit() {
|
||||
|
||||
this.id = 1;
|
||||
this.armor = 1;
|
||||
this.structure = 1;
|
||||
this.overheat = 1;
|
||||
this.damageShort = 1;
|
||||
this.damageMedium = 1;
|
||||
this.damageLong = 1;
|
||||
this.damageExtreme = 1;
|
||||
this.baseBP = 1;
|
||||
this.tonnage = 1;
|
||||
this.mechClass = "None";
|
||||
this.mechVariant = "None";
|
||||
this.role= "None";
|
||||
this.Abilities = "None";
|
||||
this.movement = "None";
|
||||
this.technology = "None";
|
||||
|
||||
}
|
||||
|
||||
public Unit(int id, int armor, int structure, int overheat, int damageShort, int damageMedium,
|
||||
int damageLong, int damageExtreme, int baseBP, int tonnage, int tmm, Pilot pilot,
|
||||
String mechClass, String mechVariant, String role, String Abilities, String movement,
|
||||
String technology) {
|
||||
this.id = id;
|
||||
this.armor = armor;
|
||||
this.structure = structure;
|
||||
this.overheat = overheat;
|
||||
this.damageShort = damageShort;
|
||||
this.damageMedium = damageMedium;
|
||||
this.damageLong = damageLong;
|
||||
this.damageExtreme = damageExtreme;
|
||||
this.baseBP = baseBP;
|
||||
this.tonnage = tonnage;
|
||||
this.pilot = pilot;
|
||||
this.mechClass = mechClass;
|
||||
this.mechVariant = mechVariant;
|
||||
this.role= role;
|
||||
this.Abilities = Abilities;
|
||||
this.movement = movement;
|
||||
this.technology = technology;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new GsonBuilder().create().toJson(this, Unit.class);
|
||||
}
|
||||
|
||||
public String CalcTmm() {
|
||||
int move;
|
||||
if(movement.replace("\"","").replace("j","").replace("a","").replace("f","").split("/")[0] == ""){
|
||||
return "";
|
||||
}
|
||||
move = Integer.valueOf(movement.replace("\"","")
|
||||
.replace("j","")
|
||||
.replace("a","")
|
||||
.replace("t","")
|
||||
.replace("f","")
|
||||
.replace("m", "")
|
||||
.replace("h", "")
|
||||
.replace("n", "")
|
||||
.replace("s", "")
|
||||
.replace("v", "")
|
||||
.replace("w", "")
|
||||
.replace("(b)", "")
|
||||
.replace("(w)", "")
|
||||
.replace("g", "")
|
||||
.split("/")[0]);
|
||||
|
||||
if(move >= 0 && move <= 4) {
|
||||
tmm = 0;
|
||||
return Integer.toString(tmm);
|
||||
}
|
||||
else if(move >= 5 && move <= 8) {
|
||||
tmm = 1;
|
||||
return Integer.toString(tmm);
|
||||
}
|
||||
else if(move >= 9 && move <= 12) {
|
||||
tmm = 2;
|
||||
return Integer.toString(tmm);
|
||||
}
|
||||
else if(move >= 13 && move <= 18) {
|
||||
tmm = 3;
|
||||
return Integer.toString(tmm);
|
||||
}
|
||||
else if(move >= 19 && move <= 34) {
|
||||
tmm = 4;
|
||||
return Integer.toString(tmm);
|
||||
}
|
||||
else if(move >= 35){
|
||||
tmm = 5;
|
||||
return Integer.toString(tmm);
|
||||
}
|
||||
return Integer.toString(tmm);
|
||||
}
|
||||
}
|
||||
76
Sorce/app/src/main/java/com/main/alphaunit/bul/UnitLists.java
Executable file
@@ -0,0 +1,76 @@
|
||||
package com.main.alphaunit.bul;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class UnitLists implements Serializable {
|
||||
ArrayList<Unit> units = new ArrayList<>();
|
||||
String listName;
|
||||
String listDescription;
|
||||
boolean selected = false;
|
||||
int pointcount;
|
||||
|
||||
public UnitLists(String name, String description) {
|
||||
listName = name;
|
||||
listDescription = description;
|
||||
}
|
||||
|
||||
private void setBp() {
|
||||
Unit tmp;
|
||||
pointcount = 0;
|
||||
for (int i = 0; i < units.size(); i++) {
|
||||
pointcount += units.get(i).baseBP;
|
||||
}
|
||||
}
|
||||
|
||||
public void setUnits(ArrayList<Unit> units) {
|
||||
this.units = units;
|
||||
}
|
||||
public void select() {
|
||||
selected = true;
|
||||
}
|
||||
public void deselect() {
|
||||
selected = false;
|
||||
}
|
||||
public boolean isSelected() {return selected;}
|
||||
public String getDescription() {return listDescription;}
|
||||
public String getName() {return listName;}
|
||||
public int getPointCount() {setBp(); return pointcount;}
|
||||
|
||||
public void addUnit(Unit unit) {
|
||||
units.add(unit);
|
||||
setBp();
|
||||
}
|
||||
|
||||
public void save(Context con) {
|
||||
|
||||
FileOutputStream outputStream;
|
||||
File t = new File(con.getFilesDir(),listName+".json");
|
||||
try {
|
||||
t.createNewFile();
|
||||
outputStream = new FileOutputStream(t);
|
||||
ObjectOutputStream objOutStream = new ObjectOutputStream(outputStream);
|
||||
objOutStream.writeObject(units);
|
||||
objOutStream.close();
|
||||
}catch (Exception e) {
|
||||
Log.e("UNIT", "loadMasterSelection: Did not read to file:\n" + e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public ArrayList<Unit> getUnits() {
|
||||
return units;
|
||||
}
|
||||
}
|
||||
|
||||
55
Sorce/app/src/main/java/com/main/alphaunit/bul/UnitListsManager.java
Executable file
@@ -0,0 +1,55 @@
|
||||
package com.main.alphaunit.bul;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class UnitListsManager {
|
||||
|
||||
static UnitLists comUnitList;
|
||||
public static ArrayList<UnitLists> unitsLists = new ArrayList<>();
|
||||
public static void setSelectedUnitList(UnitLists unitList) {
|
||||
if(comUnitList != null) {
|
||||
comUnitList.deselect();
|
||||
}
|
||||
unitList.select();
|
||||
comUnitList = unitList;
|
||||
}
|
||||
public static UnitLists getSelectedUnitList() {
|
||||
|
||||
return comUnitList;
|
||||
}
|
||||
|
||||
public static void saveUnitLists(Context con) {
|
||||
FileOutputStream outputStream;
|
||||
File t = new File(con.getFilesDir(),"U.json");
|
||||
try {
|
||||
t.createNewFile();
|
||||
outputStream = new FileOutputStream(t);
|
||||
ObjectOutputStream objOutStream = new ObjectOutputStream(outputStream);
|
||||
objOutStream.writeObject(unitsLists);
|
||||
objOutStream.close();
|
||||
}catch (Exception e) {
|
||||
Log.e("UNIT", "loadMasterSelection: Did not read to file:\n" + e.toString());
|
||||
}
|
||||
}
|
||||
public static void loadUnitLists(Context con) {
|
||||
FileInputStream inputStream;
|
||||
File t = new File(con.getFilesDir(),"U.json");
|
||||
try {
|
||||
t.createNewFile();
|
||||
inputStream = new FileInputStream(t);
|
||||
ObjectInputStream objInStream = new ObjectInputStream(inputStream);
|
||||
unitsLists = (ArrayList<UnitLists>)objInStream.readObject();
|
||||
objInStream.close();
|
||||
}catch (Exception e) {
|
||||
Log.e("UNIT", "loadMasterSelection: Did not write to file\n" + e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.main.alphaunit.bul;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.main.alphaunit.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class UnitLists_RecyclerViewAdapter extends RecyclerView.Adapter<UnitLists_RecyclerViewAdapter.MyViewHolder> {
|
||||
Context context;
|
||||
ArrayList<UnitLists> unitLists;
|
||||
public UnitLists_RecyclerViewAdapter(Context con, ArrayList<UnitLists> unitLists) {
|
||||
context = con;
|
||||
this.unitLists = unitLists;
|
||||
}
|
||||
@NonNull
|
||||
@Override
|
||||
public UnitLists_RecyclerViewAdapter.MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
LayoutInflater inflater = LayoutInflater.from(context);
|
||||
View view = inflater.inflate(R.layout.unitlist_card_layout,parent,false);
|
||||
|
||||
return new UnitLists_RecyclerViewAdapter.MyViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull UnitLists_RecyclerViewAdapter.MyViewHolder holder, int position) {
|
||||
holder.name.setText("" +unitLists.get(position).listName);
|
||||
holder.description.setText("" + unitLists.get(position).listDescription);
|
||||
holder.battlePoints.setText("" + unitLists.get(position).getPointCount());
|
||||
holder.tonnage.setText("Tonnage");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return unitLists.size();
|
||||
}
|
||||
|
||||
public static class MyViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
TextView name;
|
||||
TextView description;
|
||||
TextView battlePoints;
|
||||
TextView tonnage;
|
||||
public MyViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
name = itemView.findViewById(R.id.UnitListName);
|
||||
description = itemView.findViewById(R.id.UnitListDescription);
|
||||
battlePoints = itemView.findViewById(R.id.BattleValue);
|
||||
tonnage = itemView.findViewById(R.id.Tonnage);
|
||||
}
|
||||
}
|
||||
}
|
||||
63
Sorce/app/src/main/java/com/main/alphaunit/bul/UnitOnUITouch.java
Executable file
@@ -0,0 +1,63 @@
|
||||
package com.main.alphaunit.bul;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.GestureDetector;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
public class UnitOnUITouch implements RecyclerView.OnItemTouchListener {
|
||||
|
||||
private OnItemClickListener listener;
|
||||
|
||||
|
||||
public interface OnItemClickListener {
|
||||
public void onItemClick(View view, int position);
|
||||
|
||||
public void onLongItemClick(View view, int position);
|
||||
}
|
||||
|
||||
GestureDetector gestureDetector;
|
||||
|
||||
public UnitOnUITouch(Context context, final RecyclerView recyclerView, OnItemClickListener listener) {
|
||||
this.listener = listener;
|
||||
gestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener() {
|
||||
@Override
|
||||
public boolean onSingleTapUp(MotionEvent e) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLongPress(MotionEvent e) {
|
||||
View child = recyclerView.findChildViewUnder(e.getX(), e.getY());
|
||||
if(child != null && listener != null) {
|
||||
listener.onLongItemClick(child,recyclerView.getChildAdapterPosition(child));
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onInterceptTouchEvent(@NonNull RecyclerView rv, @NonNull MotionEvent e) {
|
||||
View childView = rv.findChildViewUnder(e.getX(), e.getY());
|
||||
if(childView != null && listener != null && gestureDetector.onTouchEvent(e)) {
|
||||
listener.onItemClick(childView, rv.getChildAdapterPosition(childView));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTouchEvent(@NonNull RecyclerView rv, @NonNull MotionEvent e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {
|
||||
|
||||
}
|
||||
}
|
||||
99
Sorce/app/src/main/java/com/main/alphaunit/bul/Unit_RecyclerViewAdapter.java
Executable file
@@ -0,0 +1,99 @@
|
||||
package com.main.alphaunit.bul;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.main.alphaunit.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Unit_RecyclerViewAdapter extends RecyclerView.Adapter<Unit_RecyclerViewAdapter.MyViewHolder> {
|
||||
|
||||
Context context;
|
||||
ArrayList<Unit> units;
|
||||
|
||||
public Unit_RecyclerViewAdapter(Context context, ArrayList<Unit> units) {
|
||||
this.context = context;
|
||||
this.units = units;
|
||||
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Unit_RecyclerViewAdapter.MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
LayoutInflater inflater = LayoutInflater.from(context);
|
||||
View view = inflater.inflate(R.layout.unit_card_layout,parent,false);
|
||||
|
||||
return new Unit_RecyclerViewAdapter.MyViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull Unit_RecyclerViewAdapter.MyViewHolder holder, int position) {
|
||||
holder.mechClass.setText(""+units.get(position).mechClass);
|
||||
holder.mechVar.setText(""+units.get(position).mechVariant);
|
||||
holder.movement.setText(""+units.get(position).movement);
|
||||
holder.BP.setText("PV: "+units.get(position).baseBP);
|
||||
holder.Abilities.setText(""+units.get(position).Abilities);
|
||||
holder.Armor.setText(""+units.get(position).armor);
|
||||
holder.Structure.setText(""+units.get(position).structure);
|
||||
holder.Role.setText(""+units.get(position).role);
|
||||
holder.DamageShort.setText("+0\n"+units.get(position).damageShort);
|
||||
holder.DamageMedium.setText("+2\n"+units.get(position).damageMedium);
|
||||
holder.DamageLong.setText("+4\n"+units.get(position).damageLong);
|
||||
holder.DamageExtreme.setText("+6\n"+units.get(position).damageExtreme);
|
||||
holder.tmm.setText("TMM:"+units.get(position).CalcTmm());
|
||||
holder.overHeat.setText("OV:"+units.get(position).overheat);
|
||||
holder.tonnage.setText("Tons:"+units.get(position).tonnage);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return units.size();
|
||||
}
|
||||
|
||||
public static class MyViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
TextView mechClass;
|
||||
TextView mechVar;
|
||||
TextView movement;
|
||||
TextView overHeat;
|
||||
TextView tonnage;
|
||||
TextView pilotName;
|
||||
TextView pilotSkill;
|
||||
TextView BP;
|
||||
TextView Abilities;
|
||||
TextView Role;
|
||||
TextView Armor, Structure;
|
||||
TextView DamageShort, DamageMedium, DamageLong, DamageExtreme;
|
||||
TextView tmm;
|
||||
|
||||
public MyViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
mechClass = itemView.findViewById(R.id.Class);
|
||||
mechVar = itemView.findViewById(R.id.Var);
|
||||
movement = itemView.findViewById(R.id.Movement);
|
||||
//pilotName = itemView.findViewById(R.id.PilotName);
|
||||
//pilotSkill = itemView.findViewById(R.id.PilotSkill);
|
||||
BP = itemView.findViewById(R.id.Bp);
|
||||
Abilities = itemView.findViewById(R.id.Abilities);
|
||||
Role = itemView.findViewById(R.id.Role);
|
||||
Armor = itemView.findViewById(R.id.Armor);
|
||||
Structure = itemView.findViewById(R.id.Structure);
|
||||
DamageShort = itemView.findViewById(R.id.DamageShort);
|
||||
DamageMedium = itemView.findViewById(R.id.DamageMedium);
|
||||
DamageLong = itemView.findViewById(R.id.DamageLong);
|
||||
DamageExtreme = itemView.findViewById(R.id.DamageExtreme);
|
||||
tmm = itemView.findViewById(R.id.tmm);
|
||||
overHeat = itemView.findViewById(R.id.Over_Heat_TV);
|
||||
tonnage = itemView.findViewById(R.id.Tonnage_TextView);
|
||||
}
|
||||
}
|
||||
}
|
||||
123
Sorce/app/src/main/java/com/main/alphaunit/bul/UserMasterUnitSelection.java
Executable file
@@ -0,0 +1,123 @@
|
||||
package com.main.alphaunit.bul;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Environment;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class UserMasterUnitSelection {
|
||||
|
||||
private static ArrayList<Unit> masterSelection;
|
||||
|
||||
public static ArrayList<Unit> getMasterSelection() { return masterSelection; }
|
||||
public static void setMasterSelection(ArrayList<Unit> units) { masterSelection = units; }
|
||||
public static void addUnit(Unit unit) { masterSelection.add(unit); }
|
||||
|
||||
public static ArrayList<Unit> getUnitByName(String name) {
|
||||
ArrayList<Unit> unitsByName = new ArrayList<Unit>();
|
||||
for (Unit unit : masterSelection) {
|
||||
boolean hasUnit = false;
|
||||
for (Unit unitb : unitsByName) {
|
||||
if(unit.mechClass == unitb.mechClass){
|
||||
hasUnit = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!hasUnit) {
|
||||
unitsByName.add(unit);
|
||||
}
|
||||
}
|
||||
return unitsByName;
|
||||
}
|
||||
|
||||
public static Unit getUnitById(int id) {
|
||||
ArrayList<Unit> unitsById = new ArrayList<>();
|
||||
for (Unit unit : masterSelection) {
|
||||
if(unit.id == id) {
|
||||
return unit;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ArrayList<Unit> getUnitsByRole(String role) {
|
||||
ArrayList<Unit> unitsByRole = new ArrayList<>();
|
||||
for (Unit unit : masterSelection) {
|
||||
boolean hasUnit = false;
|
||||
for (Unit unitb : unitsByRole) {
|
||||
if(unit.mechClass == unitb.mechClass){
|
||||
hasUnit = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!hasUnit) {
|
||||
unitsByRole.add(unit);
|
||||
}
|
||||
}
|
||||
return unitsByRole;
|
||||
}
|
||||
|
||||
public static ArrayList<Unit> getUnitsBySize(int size) {
|
||||
ArrayList<Unit> unitsBySize = new ArrayList<>();
|
||||
for (Unit unit : masterSelection) {
|
||||
boolean hasUnit = false;
|
||||
for (Unit unitb : unitsBySize) {
|
||||
if(unit.mechClass == unitb.mechClass){
|
||||
hasUnit = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!hasUnit) {
|
||||
unitsBySize.add(unit);
|
||||
}
|
||||
}
|
||||
return unitsBySize;
|
||||
}
|
||||
|
||||
// loads the master list from the masterSelectionJson
|
||||
public static void loadMasterSelection(Context con) {
|
||||
FileOutputStream outputStream;
|
||||
File t = new File(con.getFilesDir(),"test.json");
|
||||
try {
|
||||
t.createNewFile();
|
||||
outputStream = new FileOutputStream(t);
|
||||
ObjectOutputStream objOutStream = new ObjectOutputStream(outputStream);
|
||||
objOutStream.writeObject(masterSelection);
|
||||
objOutStream.close();
|
||||
}catch (Exception e) {
|
||||
Log.e("UNIT", "loadMasterSelection: Did not read to file:\n" + e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
// Saves the master list to a json file
|
||||
public static void saveMasterSelection(Context con) {
|
||||
FileInputStream inputStream;
|
||||
File t = new File(con.getFilesDir(),"test.json");
|
||||
try {
|
||||
t.createNewFile();
|
||||
inputStream = new FileInputStream(t);
|
||||
ObjectInputStream objInStream = new ObjectInputStream(inputStream);
|
||||
masterSelection = (ArrayList<Unit>)objInStream.readObject();
|
||||
objInStream.close();
|
||||
}catch (Exception e) {
|
||||
Log.e("UNIT", "loadMasterSelection: Did not write to file\n" + e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
21
Sorce/app/src/main/res/anim/blink.xml
Executable file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<alpha android:fromAlpha="0.0"
|
||||
android:toAlpha="1.0"
|
||||
android:interpolator="@android:anim/accelerate_interpolator"
|
||||
android:duration="500"
|
||||
/>
|
||||
<translate
|
||||
android:fromYDelta="0dp"
|
||||
android:toYDelta="5dp"
|
||||
android:duration="100"
|
||||
android:repeatMode="reverse"
|
||||
android:repeatCount="1"/>
|
||||
<translate
|
||||
android:delay="100"
|
||||
android:fromXDelta="0dp"
|
||||
android:toXDelta="5dp"
|
||||
android:duration="100"
|
||||
android:repeatMode="reverse"
|
||||
android:repeatCount="1"/>
|
||||
</set>
|
||||
9
Sorce/app/src/main/res/anim/unitlist_move_up.xml
Executable file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<scale
|
||||
android:fromYScale="800dp"
|
||||
android:toYScale="600dp"
|
||||
android:duration="500"
|
||||
/>
|
||||
|
||||
</set>
|
||||
30
Sorce/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
Executable file
@@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
||||
5
Sorce/app/src/main/res/drawable/baseline_folder_24.xml
Executable file
@@ -0,0 +1,5 @@
|
||||
<vector android:height="24dp" android:tint="@color/Yellow"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M10,4H4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V8c0,-1.1 -0.9,-2 -2,-2h-8l-2,-2z"/>
|
||||
</vector>
|
||||
170
Sorce/app/src/main/res/drawable/ic_launcher_background.xml
Executable file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M9,0L9,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,0L19,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,0L29,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,0L39,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,0L49,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,0L59,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,0L69,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,0L79,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M89,0L89,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M99,0L99,108"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,9L108,9"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,19L108,19"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,29L108,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,39L108,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,49L108,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,59L108,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,69L108,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,79L108,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,89L108,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M0,99L108,99"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,29L89,29"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,39L89,39"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,49L89,49"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,59L89,59"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,69L89,69"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M19,79L89,79"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M29,19L29,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M39,19L39,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M49,19L49,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M59,19L59,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M69,19L69,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M79,19L79,89"
|
||||
android:strokeWidth="0.8"
|
||||
android:strokeColor="#33FFFFFF" />
|
||||
</vector>
|
||||
5
Sorce/app/src/main/res/drawable/list_view_icon.xml
Executable file
@@ -0,0 +1,5 @@
|
||||
<vector android:autoMirrored="true" android:height="24dp"
|
||||
android:tint="@color/white" android:viewportHeight="24"
|
||||
android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M19,5v14L5,19L5,5h14m1.1,-2L3.9,3c-0.5,0 -0.9,0.4 -0.9,0.9v16.2c0,0.4 0.4,0.9 0.9,0.9h16.2c0.4,0 0.9,-0.5 0.9,-0.9L21,3.9c0,-0.5 -0.5,-0.9 -0.9,-0.9zM11,7h6v2h-6L11,7zM11,11h6v2h-6v-2zM11,15h6v2h-6zM7,7h2v2L7,9zM7,11h2v2L7,13zM7,15h2v2L7,17z"/>
|
||||
</vector>
|
||||
5
Sorce/app/src/main/res/drawable/mul_icon.xml
Executable file
@@ -0,0 +1,5 @@
|
||||
<vector android:autoMirrored="true" android:height="24dp"
|
||||
android:tint="@color/Blue" android:viewportHeight="24"
|
||||
android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M3,14h4v-4H3V14zM3,19h4v-4H3V19zM3,9h4V5H3V9zM8,14h13v-4H8V14zM8,19h13v-4H8V19zM8,5v4h13V5H8z"/>
|
||||
</vector>
|
||||
5
Sorce/app/src/main/res/drawable/quick_roles_tables.xml
Executable file
@@ -0,0 +1,5 @@
|
||||
<vector android:autoMirrored="true" android:height="24dp"
|
||||
android:tint="@color/Red" android:viewportHeight="24"
|
||||
android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M4,6L2,6v14c0,1.1 0.9,2 2,2h14v-2L4,20L4,6zM20,2L8,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM19,11L9,11L9,9h10v2zM15,15L9,15v-2h6v2zM19,7L9,7L9,5h10v2z"/>
|
||||
</vector>
|
||||
153
Sorce/app/src/main/res/layout/activity_main.xml
Executable file
@@ -0,0 +1,153 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/SlideMenu"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
|
||||
app:icon="?android:attr/actionModeFindDrawable"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/cardView2"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/cardView2"
|
||||
app:layout_constraintVertical_bias="1.0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/Data"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Test"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cardView2"
|
||||
android:layout_width="298dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_margin="5dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:stateListAnimator="@null"
|
||||
app:cardCornerRadius="20dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/SlideMenu"
|
||||
app:layout_constraintTop_toBottomOf="@+id/Data">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
app:cardBackgroundColor="@color/Blue"
|
||||
app:cardCornerRadius="20dp">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/UnitSearch"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:hint="Unit Name"
|
||||
android:imeOptions="actionSearch"
|
||||
android:inputType="text"
|
||||
app:searchPrefixText="Unit" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/unitsrlContiner"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="32dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/cardView2"
|
||||
app:layout_constraintVertical_bias="0.0">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/unitsrl"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="356dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginVertical="10dp"
|
||||
android:layout_marginTop="286dp"
|
||||
android:layout_marginBottom="286dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/RUnitView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp">
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/BottomMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:translationY="0dp"
|
||||
android:visibility="visible"
|
||||
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/UnitImageView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<ScrollView
|
||||
android:background="@color/Black"
|
||||
android:padding="5dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="500dp" >
|
||||
|
||||
<WebView
|
||||
android:id="@+id/mechWiki_View"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</ScrollView>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/Point_Value_TV"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/Yellow"
|
||||
android:text="PV: "
|
||||
app:layout_constraintBottom_toTopOf="@+id/unitsrlContiner"
|
||||
app:layout_constraintStart_toStartOf="@+id/SlideMenu"
|
||||
app:layout_constraintTop_toBottomOf="@+id/SlideMenu" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/Tonnage_TV"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="32dp"
|
||||
android:textColor="@color/Red"
|
||||
android:text="Tonnage"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/Point_Value_TV"
|
||||
app:layout_constraintStart_toEndOf="@+id/Point_Value_TV"
|
||||
app:layout_constraintTop_toTopOf="@+id/Point_Value_TV" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
56
Sorce/app/src/main/res/layout/activity_pilot_creation.xml
Normal file
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".PilotCreation">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/editTextNumberSigned" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/Pilot_Name_Edit_Text_View"
|
||||
android:layout_width="153dp"
|
||||
android:layout_height="55dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:ems="10"
|
||||
android:hint="Pilot Name"
|
||||
android:inputType="text"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/editTextNumberSigned"
|
||||
android:layout_width="95dp"
|
||||
android:layout_height="51dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:ems="10"
|
||||
android:hint="Skill"
|
||||
android:inputType="numberSigned"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/Pilot_Name_Edit_Text_View" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/Add_Pilot_Button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:text="Add"
|
||||
android:background="@color/Black"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/editTextNumberSigned"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/Pilot_Name_Edit_Text_View" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
71
Sorce/app/src/main/res/layout/activity_unit_lists_selection.xml
Executable file
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".UnitListsSelection">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/UnitListRecyclerView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/UnitDescriptionIn" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/AddUnitList"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="Add List"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/unitListNameIn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:ems="10"
|
||||
android:inputType="text"
|
||||
android:text="Name"
|
||||
app:layout_constraintStart_toStartOf="@+id/AddUnitList"
|
||||
app:layout_constraintTop_toBottomOf="@+id/AddUnitList" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/UnitDescriptionIn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:ems="10"
|
||||
android:inputType="text"
|
||||
android:text="Description"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/unitListNameIn" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/BackToMainActivity"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="Units"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dbug"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="3dp"
|
||||
android:text="TextView"
|
||||
app:layout_constraintStart_toEndOf="@+id/AddUnitList"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
258
Sorce/app/src/main/res/layout/unit_card_layout.xml
Executable file
@@ -0,0 +1,258 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/MyCard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
app:cardBackgroundColor="@color/Black"
|
||||
app:cardCornerRadius="20dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/Tonnage_TextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="TextView"
|
||||
android:textColor="@color/Red"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/Bp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/Movement"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="Movement"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/Abilities"
|
||||
app:layout_constraintStart_toStartOf="@+id/Class"
|
||||
app:layout_constraintTop_toBottomOf="@+id/Var"
|
||||
app:layout_constraintVertical_bias="1.0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/Abilities"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="Abilitys"
|
||||
android:textColor="@color/Green"
|
||||
android:textSize="14sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/Over_Heat_TV" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/Var"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="Var"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="8sp"
|
||||
app:layout_constraintStart_toStartOf="@+id/Class"
|
||||
app:layout_constraintTop_toBottomOf="@+id/Class" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/Bp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="BP"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/PilotSkill"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:text="Pilot Skill"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/PilotName"
|
||||
app:layout_constraintStart_toEndOf="@+id/PilotName"
|
||||
app:layout_constraintTop_toTopOf="@+id/PilotName" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/PilotName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:text="Pilot Name"
|
||||
android:textColor="@color/white"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/Class"
|
||||
app:layout_constraintStart_toEndOf="@+id/Class"
|
||||
app:layout_constraintTop_toTopOf="@+id/Class" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/Class"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="class"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/Role"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Role"
|
||||
android:textColor="@color/Yellow"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/Abilities"
|
||||
app:layout_constraintEnd_toEndOf="@+id/Bp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/Structure"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="Structure"
|
||||
android:textColor="@color/Red"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintStart_toEndOf="@+id/textView4"
|
||||
app:layout_constraintTop_toTopOf="@+id/linearLayout" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/Armor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="Armor"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/linearLayout"
|
||||
app:layout_constraintStart_toEndOf="@+id/textView3"
|
||||
app:layout_constraintTop_toBottomOf="@+id/Structure"
|
||||
app:layout_constraintVertical_bias="0.666" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="86dp"
|
||||
android:text="S"
|
||||
android:textColor="@color/Red"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/Structure"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/Structure"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="A"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/Armor"
|
||||
app:layout_constraintEnd_toStartOf="@+id/Structure"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="@+id/textView4" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toTopOf="@+id/Role"
|
||||
app:layout_constraintStart_toEndOf="@+id/Structure"
|
||||
app:layout_constraintTop_toBottomOf="@+id/PilotSkill">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/DamageShort"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:text="+1\nShort"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Blue" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/DamageMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:text="+2\nShort"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Green" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/DamageLong"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:text="+4\nShort"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Yellow" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/DamageExtreme"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:text="+4\nShort"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/Red" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tmm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="tmm"
|
||||
android:textColor="@color/Blue"
|
||||
app:layout_constraintBottom_toTopOf="@+id/Movement"
|
||||
app:layout_constraintStart_toStartOf="@+id/Var"
|
||||
app:layout_constraintTop_toBottomOf="@+id/Var" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/Over_Heat_TV"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_marginStart="8dp"
|
||||
android:textSize="12dp"
|
||||
android:text="OV"
|
||||
android:textColor="@color/Red"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/Movement"
|
||||
app:layout_constraintStart_toEndOf="@+id/Movement" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
70
Sorce/app/src/main/res/layout/unitlist_card_layout.xml
Executable file
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/ListNameCard"
|
||||
android:layout_width="400dp"
|
||||
android:layout_height="100dp"
|
||||
app:cardCornerRadius="20dp"
|
||||
app:cardBackgroundColor="@color/Black"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" >
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/UnitListName"
|
||||
android:textColor="@color/white"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:textSize="24dp"
|
||||
android:text="List Name"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/BattleValue"
|
||||
android:textColor="@color/Yellow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:textSize="16dp"
|
||||
android:text="TextView"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/UnitListDescription"
|
||||
android:textColor="@color/Green"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:text="TextView"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/UnitListName"
|
||||
app:layout_constraintTop_toBottomOf="@+id/UnitListName" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/Tonnage"
|
||||
android:textColor="@color/Red"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="TextView"
|
||||
app:layout_constraintEnd_toEndOf="@+id/BattleValue"
|
||||
app:layout_constraintTop_toBottomOf="@+id/BattleValue" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
5
Sorce/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Executable file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
5
Sorce/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Executable file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
BIN
Sorce/app/src/main/res/mipmap-hdpi/ic_launcher.webp
Executable file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
Sorce/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
Executable file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
Sorce/app/src/main/res/mipmap-mdpi/ic_launcher.webp
Executable file
|
After Width: | Height: | Size: 982 B |
BIN
Sorce/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Executable file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
Sorce/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
Executable file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
Sorce/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
Executable file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
Sorce/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Executable file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
Sorce/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
Executable file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
Sorce/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Executable file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
Sorce/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
Executable file
|
After Width: | Height: | Size: 7.6 KiB |
16
Sorce/app/src/main/res/values-night/themes.xml
Executable file
@@ -0,0 +1,16 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.AlphaUnit" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/Black</item>
|
||||
<item name="colorPrimaryVariant">@color/Blue</item>
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/Green</item>
|
||||
<item name="colorSecondaryVariant">@color/Yellow</item>
|
||||
<item name="colorOnSecondary">@color/Black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
</resources>
|
||||
9
Sorce/app/src/main/res/values/colors.xml
Executable file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="Red">#A5243D</color>
|
||||
<color name="Yellow">#F5CB5C</color>
|
||||
<color name="Blue">#37718E</color>
|
||||
<color name="Green">#72A276</color>
|
||||
<color name="Black">#1D1E18</color>
|
||||
<color name="white">#F8F8F8</color>
|
||||
</resources>
|
||||
5
Sorce/app/src/main/res/values/ids.xml
Executable file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<item name="Abilities" type="id"></item>
|
||||
<item name="Role" type="id"></item>
|
||||
</resources>
|
||||
5
Sorce/app/src/main/res/values/strings.xml
Executable file
@@ -0,0 +1,5 @@
|
||||
<resources>
|
||||
<string name="app_name">AlphaUnit</string>
|
||||
<!-- TODO: Remove or change this placeholder text -->
|
||||
<string name="hello_blank_fragment">Hello blank fragment</string>
|
||||
</resources>
|
||||
16
Sorce/app/src/main/res/values/themes.xml
Executable file
@@ -0,0 +1,16 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.AlphaUnit" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/Black</item>
|
||||
<item name="colorPrimaryVariant">@color/Blue</item>
|
||||
<item name="colorOnPrimary">@color/white</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/Green</item>
|
||||
<item name="colorSecondaryVariant">@color/Yellow</item>
|
||||
<item name="colorOnSecondary">@color/Black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||
<!-- Customize your theme here. -->
|
||||
</style>
|
||||
</resources>
|
||||
13
Sorce/app/src/main/res/xml/backup_rules.xml
Executable file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample backup rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/guide/topics/data/autobackup
|
||||
for details.
|
||||
Note: This file is ignored for devices older that API 31
|
||||
See https://developer.android.com/about/versions/12/backup-restore
|
||||
-->
|
||||
<full-backup-content>
|
||||
<!--
|
||||
<include domain="sharedpref" path="."/>
|
||||
<exclude domain="sharedpref" path="device.xml"/>
|
||||
-->
|
||||
</full-backup-content>
|
||||
19
Sorce/app/src/main/res/xml/data_extraction_rules.xml
Executable file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
Sample data extraction rules file; uncomment and customize as necessary.
|
||||
See https://developer.android.com/about/versions/12/backup-restore#xml-changes
|
||||
for details.
|
||||
-->
|
||||
<data-extraction-rules>
|
||||
<cloud-backup>
|
||||
<!-- TODO: Use <include> and <exclude> to control what is backed up.
|
||||
<include .../>
|
||||
<exclude .../>
|
||||
-->
|
||||
</cloud-backup>
|
||||
<!--
|
||||
<device-transfer>
|
||||
<include .../>
|
||||
<exclude .../>
|
||||
</device-transfer>
|
||||
-->
|
||||
</data-extraction-rules>
|
||||
17
Sorce/app/src/test/java/com/main/alphaunit/ExampleUnitTest.java
Executable file
@@ -0,0 +1,17 @@
|
||||
package com.main.alphaunit;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||
5
Sorce/build.gradle
Executable file
@@ -0,0 +1,5 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
plugins {
|
||||
id 'com.android.application' version '8.1.0' apply false
|
||||
id 'com.android.library' version '8.1.0' apply false
|
||||
}
|
||||
23
Sorce/gradle.properties
Executable file
@@ -0,0 +1,23 @@
|
||||
# Project-wide Gradle settings.
|
||||
# IDE (e.g. Android Studio) users:
|
||||
# Gradle settings configured through the IDE *will override*
|
||||
# any settings specified in this file.
|
||||
# For more details on how to configure your build environment visit
|
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||
# Android operating system, and which are packaged with your app's APK
|
||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||
android.useAndroidX=true
|
||||
# Enables namespacing of each library's R class so that its R class includes only the
|
||||
# resources declared in the library itself and none from the library's dependencies,
|
||||
# thereby reducing the size of the R class for that library
|
||||
android.nonTransitiveRClass=true
|
||||
android.defaults.buildfeatures.buildconfig=true
|
||||
android.nonFinalResIds=false
|
||||
BIN
Sorce/gradle/wrapper/gradle-wrapper.jar
vendored
Executable file
6
Sorce/gradle/wrapper/gradle-wrapper.properties
vendored
Executable file
@@ -0,0 +1,6 @@
|
||||
#Wed Aug 02 21:03:51 PDT 2023
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
185
Sorce/gradlew
vendored
Executable file
@@ -0,0 +1,185 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
case $i in
|
||||
0) set -- ;;
|
||||
1) set -- "$args0" ;;
|
||||
2) set -- "$args0" "$args1" ;;
|
||||
3) set -- "$args0" "$args1" "$args2" ;;
|
||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=`save "$@"`
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
89
Sorce/gradlew.bat
vendored
Executable file
@@ -0,0 +1,89 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
16
Sorce/settings.gradle
Executable file
@@ -0,0 +1,16 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
dependencyResolutionManagement {
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
rootProject.name = "AlphaUnit"
|
||||
include ':app'
|
||||