Latest Version (v1.4)

This commit is contained in:
nicco 2016-11-26 14:12:54 +01:00
parent 7c42d1529d
commit b9e8d512c3
62 changed files with 1608 additions and 267 deletions

BIN
.DS_Store vendored

Binary file not shown.

BIN
APK/.DS_Store vendored

Binary file not shown.

View File

@ -9,14 +9,15 @@ android {
keyPassword "Ek09iG2aB_XMlMe3kQ4mynrnPLi!PXkC" keyPassword "Ek09iG2aB_XMlMe3kQ4mynrnPLi!PXkC"
} }
} }
compileSdkVersion 24 compileSdkVersion 25
buildToolsVersion "24.0.1" buildToolsVersion "25.0.0"
defaultConfig { defaultConfig {
applicationId "io.nicco.r6s" applicationId "io.nicco.r6s"
minSdkVersion 19 minSdkVersion 19
targetSdkVersion 24 targetSdkVersion 25
versionCode 8 versionCode 13
versionName '1.2' versionName '1.4'
signingConfig signingConfigs.release
} }
buildTypes { buildTypes {
release { release {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 736 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 455 KiB

After

Width:  |  Height:  |  Size: 307 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 829 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 KiB

After

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 351 KiB

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 217 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 KiB

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 KiB

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 KiB

After

Width:  |  Height:  |  Size: 179 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 KiB

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

After

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 KiB

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 KiB

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 KiB

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 KiB

After

Width:  |  Height:  |  Size: 351 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 KiB

After

Width:  |  Height:  |  Size: 324 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 KiB

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 KiB

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 KiB

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 KiB

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

After

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

View File

@ -1,5 +1,6 @@
package io.nicco.r6s; package io.nicco.r6s;
import android.app.Activity;
import android.app.Fragment; import android.app.Fragment;
import android.content.Context; import android.content.Context;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
@ -18,6 +19,8 @@ import java.util.List;
public class OpsListAdapter extends RecyclerView.Adapter<OpsListAdapter.ViewHolder> { public class OpsListAdapter extends RecyclerView.Adapter<OpsListAdapter.ViewHolder> {
private Activity root;
public static class ViewHolder extends RecyclerView.ViewHolder { public static class ViewHolder extends RecyclerView.ViewHolder {
public TextView txt_n; public TextView txt_n;
@ -37,8 +40,9 @@ public class OpsListAdapter extends RecyclerView.Adapter<OpsListAdapter.ViewHold
private List<OpsListItem> data; private List<OpsListItem> data;
public OpsListAdapter(List<OpsListItem> d) { public OpsListAdapter(List<OpsListItem> d, Activity r) {
data = d; data = d;
root = r;
} }
@Override @Override
@ -55,7 +59,7 @@ public class OpsListAdapter extends RecyclerView.Adapter<OpsListAdapter.ViewHold
viewHolder.txt_n.setText(data.get(position).n); viewHolder.txt_n.setText(data.get(position).n);
viewHolder.txt_f.setText(data.get(position).f); viewHolder.txt_f.setText(data.get(position).f);
try { try {
InputStream ims = home.root().getAssets().open(data.get(position).i); InputStream ims = root.getAssets().open(data.get(position).i);
viewHolder.txt_i.setImageDrawable(Drawable.createFromStream(ims, null)); viewHolder.txt_i.setImageDrawable(Drawable.createFromStream(ims, null));
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
@ -67,7 +71,7 @@ public class OpsListAdapter extends RecyclerView.Adapter<OpsListAdapter.ViewHold
b.putInt("id", data.get(position).id); b.putInt("id", data.get(position).id);
Fragment f = new op_view(); Fragment f = new op_view();
f.setArguments(b); f.setArguments(b);
home.ChangeFragment(f); home.ChangeFragment(f, root);
} }
}); });
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,6 @@
package io.nicco.r6s; package io.nicco.r6s;
import android.app.Activity;
import android.app.Fragment; import android.app.Fragment;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
@ -14,6 +15,8 @@ import java.util.List;
public class WeaponsListAdapter extends RecyclerView.Adapter<WeaponsListAdapter.ViewHolder> { public class WeaponsListAdapter extends RecyclerView.Adapter<WeaponsListAdapter.ViewHolder> {
private Activity root;
public static class ViewHolder extends RecyclerView.ViewHolder { public static class ViewHolder extends RecyclerView.ViewHolder {
public TextView txt_l; public TextView txt_l;
@ -31,8 +34,9 @@ public class WeaponsListAdapter extends RecyclerView.Adapter<WeaponsListAdapter.
private List<WeaponListItem> data; private List<WeaponListItem> data;
public WeaponsListAdapter(List<WeaponListItem> d) { public WeaponsListAdapter(List<WeaponListItem> d, Activity r) {
data = d; data = d;
root = r;
} }
@Override @Override
@ -54,7 +58,7 @@ public class WeaponsListAdapter extends RecyclerView.Adapter<WeaponsListAdapter.
b.putInt("id", data.get(position).id); b.putInt("id", data.get(position).id);
Fragment f = new weapon_view(); Fragment f = new weapon_view();
f.setArguments(b); f.setArguments(b);
home.ChangeFragment(f); home.ChangeFragment(f, root);
} }
}); });
} }

View File

@ -27,7 +27,6 @@ public class home extends AppCompatActivity
private DrawerLayout drawer; private DrawerLayout drawer;
private Fragment curFrag = null; private Fragment curFrag = null;
private static Activity c;
private static String DB_PATH; private static String DB_PATH;
private static String DB_NAME; private static String DB_NAME;
private final String DB_URL = "https://raw.githubusercontent.com/CupCakeArmy/static/master/R6S/R6S.sqlite"; private final String DB_URL = "https://raw.githubusercontent.com/CupCakeArmy/static/master/R6S/R6S.sqlite";
@ -39,8 +38,6 @@ public class home extends AppCompatActivity
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
c = this;
drawer = (DrawerLayout) findViewById(R.id.drawer_layout); drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
@ -50,7 +47,7 @@ public class home extends AppCompatActivity
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this); navigationView.setNavigationItemSelectedListener(this);
ChangeFragment(new ops_view()); ChangeFragment(new ops_view(), this);
setTitle("Operators"); setTitle("Operators");
// Save DB from assets to storage // Save DB from assets to storage
@ -129,22 +126,18 @@ public class home extends AppCompatActivity
} }
setTitle(title); setTitle(title);
c.getFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE); getFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
ChangeFragment(curFrag); ChangeFragment(curFrag, this);
drawer.closeDrawer(GravityCompat.START); drawer.closeDrawer(GravityCompat.START);
return true; return true;
} }
public static void ChangeFragment(Fragment f) { public static void ChangeFragment(Fragment f, Activity a) {
c.getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.main_cont, f).commit(); a.getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.main_cont, f).commit();
} }
public static SQLiteDatabase mkdb() { public static SQLiteDatabase mkdb() {
return SQLiteDatabase.openDatabase(DB_PATH + DB_NAME, null, 0); return SQLiteDatabase.openDatabase(DB_PATH + DB_NAME, null, 0);
} }
public static Activity root() {
return c;
}
} }

View File

@ -1,8 +1,8 @@
package io.nicco.r6s; package io.nicco.r6s;
import android.app.Activity;
import android.app.Fragment; import android.app.Fragment;
import android.content.Context;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -11,33 +11,37 @@ import android.view.ViewGroup;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.Button; import android.widget.Button;
import android.widget.ImageView;
import android.widget.Spinner; import android.widget.Spinner;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static android.content.Context.MODE_PRIVATE;
public class maps_view extends Fragment { public class maps_view extends Fragment {
public maps_view() { public maps_view() {
} }
private Context root = null; private Activity root;
private Spinner maps_sel; private Spinner maps_sel;
private TextView cur_floor_txt; private TextView cur_floor_txt;
private Button btn_l; private Button btn_l;
private Button btn_r; private Button btn_r;
private ImageView img; private TouchImageView img;
private final String path = "Maps"; private final String path = "Maps";
private int cur_floor = 0; private int cur_floor = 0;
private String cur_map; private String cur_map;
private String[] maps = null; private String[] maps = null;
private final static String PREF_A = "maps_view_show_toast";
private void setImg() { private void setImg() {
InputStream ims; InputStream ims;
try { try {
@ -52,17 +56,16 @@ public class maps_view extends Fragment {
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
Bundle savedInstanceState) { root = getActivity();
View view = inflater.inflate(R.layout.fragment_maps_view, container, false); View view = inflater.inflate(R.layout.fragment_maps_view, container, false);
root = getActivity();
maps_sel = (Spinner) view.findViewById(R.id.maps_spinner); maps_sel = (Spinner) view.findViewById(R.id.maps_spinner);
cur_floor_txt = (TextView) view.findViewById(R.id.maps_cur_floor); cur_floor_txt = (TextView) view.findViewById(R.id.maps_cur_floor);
btn_l = (Button) view.findViewById(R.id.maps_btn_l); btn_l = (Button) view.findViewById(R.id.maps_btn_l);
btn_r = (Button) view.findViewById(R.id.maps_btn_r); btn_r = (Button) view.findViewById(R.id.maps_btn_r);
img = (ImageView) view.findViewById(R.id.maps_img); img = (TouchImageView) view.findViewById(R.id.maps_img);
List<String> maps_sel_cont = new ArrayList<>(); List<String> maps_sel_cont = new ArrayList<>();
@ -113,6 +116,14 @@ public class maps_view extends Fragment {
} }
}); });
img.resetZoom();
int showed_toast = Integer.parseInt(root.getPreferences(MODE_PRIVATE).getString(PREF_A, "0"));
if (showed_toast < 5) {
Toast.makeText(root, "Pinch the Map, You can ZOOM!", Toast.LENGTH_LONG).show();
root.getPreferences(MODE_PRIVATE).edit().putString(PREF_A, String.valueOf(++showed_toast)).apply();
}
return view; return view;
} }

View File

@ -1,6 +1,7 @@
package io.nicco.r6s; package io.nicco.r6s;
import android.app.Activity;
import android.app.Fragment; import android.app.Fragment;
import android.database.Cursor; import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase;
@ -9,30 +10,34 @@ import android.graphics.BitmapFactory;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.ViewTreeObserver; import android.view.ViewTreeObserver;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import static android.content.Context.MODE_PRIVATE;
public class op_view extends Fragment { public class op_view extends Fragment {
public op_view() { public op_view() {
} }
private Activity root;
private final static String PREF_A = "op_view_show_toast";
private LinearLayout mkItem(String s) { private LinearLayout mkItem(String s) {
LinearLayout frame = new LinearLayout(home.root()); LinearLayout frame = new LinearLayout(root);
TextView tmp = new TextView(home.root()); TextView tmp = new TextView(root);
LinearLayout.LayoutParams fp = new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1); LinearLayout.LayoutParams fp = new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.WRAP_CONTENT, 1);
fp.setMargins(8, 8, 8, 8); fp.setMargins(8, 8, 8, 8);
@ -59,6 +64,8 @@ public class op_view extends Fragment {
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
root = getActivity();
final View v = inflater.inflate(R.layout.fragment_op_view, container, false); final View v = inflater.inflate(R.layout.fragment_op_view, container, false);
//Get Operator Info //Get Operator Info
@ -98,7 +105,7 @@ public class op_view extends Fragment {
b.putInt("id", cur_id); b.putInt("id", cur_id);
Fragment f = new weapon_view(); Fragment f = new weapon_view();
f.setArguments(b); f.setArguments(b);
home.ChangeFragment(f); home.ChangeFragment(f, root);
} }
}); });
if (w.getString(w.getColumnIndex("class")).equals("Secondary")) { if (w.getString(w.getColumnIndex("class")).equals("Secondary")) {
@ -117,7 +124,8 @@ public class op_view extends Fragment {
//Setting Images //Setting Images
try { try {
InputStream ims = home.root().getAssets().open("Operators/" + c.getString(c.getColumnIndex("type")) + "/" + c.getString(c.getColumnIndex("name")) + ".png");
InputStream ims = root.getAssets().open("Operators/" + c.getString(c.getColumnIndex("type")) + "/" + c.getString(c.getColumnIndex("name")) + ".png");
((ImageView) v.findViewById(R.id.op_img)).setImageDrawable(Drawable.createFromStream(ims, null)); ((ImageView) v.findViewById(R.id.op_img)).setImageDrawable(Drawable.createFromStream(ims, null));
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
@ -126,38 +134,37 @@ public class op_view extends Fragment {
v.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { v.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override @Override
public void onGlobalLayout() { public void onGlobalLayout() {
Log.i("Trelelele", "ok");
try { try {
//Drawable d = Drawable.createFromStream(home.root().getAssets().open("OPs/" + String.valueOf(id) + ".jpg"), null); //Drawable d = Drawable.createFromStream(c.getAssets().open("OPs/" + String.valueOf(id) + ".jpg"), null);
ImageView op_bg = (ImageView) v.findViewById(R.id.op_bg); ImageView op_bg = (ImageView) v.findViewById(R.id.op_bg);
RelativeLayout img_cont = (RelativeLayout) v.findViewById(R.id.img_cont); Bitmap bitmap = BitmapFactory.decodeStream(root.getAssets().open("OPs/" + String.valueOf(id) + ".jpg"));
Bitmap bitmap = BitmapFactory.decodeStream(home.root().getAssets().open("OPs/" + String.valueOf(id) + ".jpg"));
int b_h = bitmap.getHeight(); int b_h = bitmap.getHeight();
int b_w = bitmap.getWidth(); int b_w = bitmap.getWidth();
//float ratio = op_bg.getHeight() / op_bg.getWidth(); int bg_h = op_bg.getHeight();
Log.i("W & H: ", op_bg.getMeasuredHeight() + " - " + op_bg.getHeight()); int bg_w = op_bg.getWidth();
/* float ratio = (float) bg_h / bg_w;
if (ratio > 1) {
// BG is portrait try {
if (b_h > b_w) { if (ratio > 1) {
//img is portrait // BG is portrait
bitmap = Bitmap.createBitmap(bitmap, 0, 0, b_h, (int) (b_h * ratio)); if (b_h > b_w) {
} else { bitmap = Bitmap.createBitmap(bitmap, 0, 0, b_w, Math.min((int) (b_w * ratio), b_h));
//img is landscape } else {
bitmap = Bitmap.createBitmap(bitmap, 0, 0, (int) (b_w / ratio), b_w); bitmap = Bitmap.createBitmap(bitmap, 0, 0, Math.min((int) (b_w / ratio), b_h), b_w);
} }
} else { } else {
//BG is landscape // BG is landscape
if (b_h > b_w) { if (b_h > b_w) {
//img is portrait bitmap = Bitmap.createBitmap(bitmap, 0, 0, b_w, (int) (b_w * ratio));
bitmap = Bitmap.createBitmap(bitmap, 0, 0, (int) (b_w / ratio), b_w); } else {
} else { bitmap = Bitmap.createBitmap(bitmap, 0, 0, b_h, (int) (b_h * ratio));
//img is landscape }
bitmap = Bitmap.createBitmap(bitmap, 0, 0, b_h, (int) (b_h * ratio)); }
} } finally {
}*/
}
//Crop //Crop
op_bg.setImageBitmap(bitmap); op_bg.setImageBitmap(bitmap);
@ -169,6 +176,12 @@ public class op_view extends Fragment {
db.close(); db.close();
int showed_toast = Integer.parseInt(root.getPreferences(MODE_PRIVATE).getString(PREF_A, "0"));
if (showed_toast < 5) {
Toast.makeText(root, "Scroll down to see more!", Toast.LENGTH_LONG).show();
root.getPreferences(MODE_PRIVATE).edit().putString(PREF_A, String.valueOf(++showed_toast)).apply();
}
return v; return v;
} }

View File

@ -1,7 +1,9 @@
package io.nicco.r6s; package io.nicco.r6s;
import android.app.Activity;
import android.app.Fragment; import android.app.Fragment;
import android.content.Context;
import android.database.Cursor; import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle; import android.os.Bundle;
@ -19,10 +21,14 @@ public class ops_view extends Fragment {
public ops_view() { public ops_view() {
} }
private Activity root;
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
root = getActivity();
View v = inflater.inflate(R.layout.fragment_ops_view, container, false); View v = inflater.inflate(R.layout.fragment_ops_view, container, false);
RecyclerView op_a_list = (RecyclerView) v.findViewById(R.id.ops_list_a); RecyclerView op_a_list = (RecyclerView) v.findViewById(R.id.ops_list_a);
RecyclerView op_d_list = (RecyclerView) v.findViewById(R.id.ops_list_d); RecyclerView op_d_list = (RecyclerView) v.findViewById(R.id.ops_list_d);
@ -54,10 +60,10 @@ public class ops_view extends Fragment {
} }
db.close(); db.close();
op_a_list.setAdapter(new OpsListAdapter(data_a)); op_a_list.setAdapter(new OpsListAdapter(data_a, root));
op_a_list.setLayoutManager(new LinearLayoutManager(home.root())); op_a_list.setLayoutManager(new LinearLayoutManager(root));
op_d_list.setAdapter(new OpsListAdapter(data_d)); op_d_list.setAdapter(new OpsListAdapter(data_d, root));
op_d_list.setLayoutManager(new LinearLayoutManager(home.root())); op_d_list.setLayoutManager(new LinearLayoutManager(root));
return v; return v;
} }

View File

@ -62,7 +62,7 @@ public class weapon_view extends Fragment {
//Setting Images //Setting Images
try { try {
InputStream ims = home.root().getAssets().open("Weapons/" + String.valueOf(id) + ".png"); InputStream ims = getActivity().getAssets().open("Weapons/" + String.valueOf(id) + ".png");
((ImageView) v.findViewById(R.id.weapon_image)).setImageDrawable(Drawable.createFromStream(ims, null)); ((ImageView) v.findViewById(R.id.weapon_image)).setImageDrawable(Drawable.createFromStream(ims, null));
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();

View File

@ -1,6 +1,7 @@
package io.nicco.r6s; package io.nicco.r6s;
import android.app.Activity;
import android.app.Fragment; import android.app.Fragment;
import android.database.Cursor; import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase;
@ -19,8 +20,12 @@ public class weapons_view extends Fragment {
public weapons_view() { public weapons_view() {
} }
private Activity root;
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
root = getActivity();
View v = inflater.inflate(R.layout.fragment_weapons_view, container, false); View v = inflater.inflate(R.layout.fragment_weapons_view, container, false);
RecyclerView weapon_list = (RecyclerView) v.findViewById(R.id.weapons_list); RecyclerView weapon_list = (RecyclerView) v.findViewById(R.id.weapons_list);
List<WeaponListItem> data = new ArrayList<>(); List<WeaponListItem> data = new ArrayList<>();
@ -40,8 +45,8 @@ public class weapons_view extends Fragment {
} }
db.close(); db.close();
weapon_list.setAdapter(new WeaponsListAdapter(data)); weapon_list.setAdapter(new WeaponsListAdapter(data, root));
weapon_list.setLayoutManager(new LinearLayoutManager(home.root())); weapon_list.setLayoutManager(new LinearLayoutManager(root));
return v; return v;
} }

View File

@ -5,15 +5,14 @@
android:orientation="vertical" android:orientation="vertical"
tools:context="io.nicco.r6s.maps_view"> tools:context="io.nicco.r6s.maps_view">
<ImageView <io.nicco.r6s.TouchImageView
android:id="@+id/maps_img" android:id="@+id/maps_img"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@color/r6s_bg" android:background="@color/r6s_bg"
android:contentDescription="@string/maps_img_type" android:contentDescription="@string/maps_img_type"
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:layout_weight="1" /> android:layout_weight="1"
android:layout_height="0dp" />
<LinearLayout <LinearLayout
android:id="@+id/maps_menu_low" android:id="@+id/maps_menu_low"

View File

@ -1,205 +1,213 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout 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" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
tools:context="io.nicco.r6s.op_view"> tools:context="io.nicco.r6s.op_view">
<RelativeLayout <ImageView
android:id="@+id/op_bg"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="match_parent"
android:layout_weight="1" android:adjustViewBounds="false"
android:id="@+id/img_cont"> android:foregroundGravity="top"
android:scaleType="centerCrop" />
<ImageView <ScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
android:id="@+id/op_bg"
android:scaleType="centerCrop"
android:adjustViewBounds="false"
android:foregroundGravity="top" />
<FrameLayout <LinearLayout
android:id="@+id/op_view_bg"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="wrap_content"
android:orientation="vertical">
<View android:id="@+id/op_view_spacer"
android:layout_width="match_parent"
android:layout_height="300dp" />
<FrameLayout
android:id="@+id/op_view_bg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="32dp">
<TextView
android:id="@+id/op_faction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#ffffff" />
<TextView
android:id="@+id/op_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#ffffff" />
<ImageView
android:id="@+id/op_img"
android:layout_width="match_parent"
android:layout_gravity="center"
android:contentDescription="@string/op_image"
android:scaleType="fitCenter"
android:layout_height="80dp" />
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:baselineAligned="false"
android:orientation="horizontal"
android:padding="16dp"
android:background="@android:color/background_light">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="@+id/op_armor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center"
android:textAppearance="@android:style/TextAppearance.Material.Large" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/op_armor"
android:textAlignment="center"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="@+id/op_type"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center"
android:textAppearance="@android:style/TextAppearance.Material.Large"
android:textSize="18sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/op_type"
android:textAlignment="center"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="@+id/op_speed"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center"
android:textAppearance="@android:style/TextAppearance.Material.Large" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/op_speed"
android:textAlignment="center"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</LinearLayout>
<TextView <TextView
android:id="@+id/op_faction" android:id="@+id/op_ability"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:textAlignment="center"
android:textAppearance="?android:attr/textAppearanceMedium"
android:background="@android:color/background_light" />
<View
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="1dp"
android:layout_gravity="right|bottom" android:background="@android:color/background_light"></View>
android:padding="32dp"
android:textAlignment="textEnd"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#ffffff" />
<TextView <LinearLayout
android:id="@+id/op_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|bottom"
android:padding="32dp"
android:textAlignment="textStart"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#ffffff" />
<ImageView
android:id="@+id/op_img"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:contentDescription="@string/op_image"
android:padding="32dp"
android:scaleType="fitCenter" />
</FrameLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:baselineAligned="false"
android:orientation="horizontal"
android:padding="32dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="@+id/op_armor"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textAlignment="center" android:orientation="vertical"
android:textAppearance="@android:style/TextAppearance.Material.Large" /> android:padding="16dp"
android:background="@android:color/background_light">
<TextView <LinearLayout
android:id="@+id/op_p_w"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"></LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="0dp"
android:text="@string/op_primary"
android:textAlignment="center"
android:textAppearance="?android:attr/textAppearanceSmall" />
<LinearLayout
android:id="@+id/op_s_w"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="0dp"
android:text="@string/op_secondary"
android:textAlignment="center"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/op_armor" android:baselineAligned="false"
android:textAlignment="center" android:orientation="vertical"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:padding="16dp"
android:background="@android:color/background_light">
<LinearLayout
android:id="@+id/op_g"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/op_gadget"
android:textAlignment="center"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</LinearLayout> </LinearLayout>
<LinearLayout </ScrollView>
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:padding="16dp">
<TextView </RelativeLayout>
android:id="@+id/op_type"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center"
android:textAppearance="@android:style/TextAppearance.Material.Large"
android:textSize="18sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/op_type"
android:textAlignment="center"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="@+id/op_speed"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center"
android:textAppearance="@android:style/TextAppearance.Material.Large" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/op_speed"
android:textAlignment="center"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/op_ability"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:textAlignment="center"
android:textAppearance="?android:attr/textAppearanceMedium" />
<View
android:layout_width="wrap_content"
android:layout_height="1dp"
android:background="@drawable/line_gradient"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<LinearLayout
android:id="@+id/op_p_w"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"></LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="0dp"
android:text="@string/op_primary"
android:textAlignment="center"
android:textAppearance="?android:attr/textAppearanceSmall" />
<LinearLayout
android:id="@+id/op_s_w"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="0dp"
android:text="@string/op_secondary"
android:textAlignment="center"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:baselineAligned="false"
android:orientation="vertical"
android:padding="16dp">
<LinearLayout
android:id="@+id/op_g"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/op_gadget"
android:textAlignment="center"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
</LinearLayout>

View File

@ -11,9 +11,9 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="#ffffffff" android:background="#ffffffff"
android:layout_marginLeft="8dp" android:layout_marginLeft="@dimen/default_spacing"
android:layout_marginTop="8dp" android:layout_marginTop="@dimen/default_spacing"
android:layout_marginRight="8dp"> android:layout_marginRight="@dimen/default_spacing">
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
@ -45,9 +45,9 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginRight="1dp" android:layout_marginRight="1dp"
android:layout_marginLeft="8dp" android:layout_marginLeft="@dimen/default_spacing"
android:layout_marginTop="8dp" android:layout_marginTop="@dimen/default_spacing"
android:layout_marginBottom="8dp" /> android:layout_marginBottom="@dimen/default_spacing" />
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/ops_list_d" android:id="@+id/ops_list_d"
@ -55,9 +55,9 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginLeft="1dp" android:layout_marginLeft="1dp"
android:layout_marginTop="8dp" android:layout_marginTop="@dimen/default_spacing"
android:layout_marginRight="8dp" android:layout_marginRight="@dimen/default_spacing"
android:layout_marginBottom="8dp" /> android:layout_marginBottom="@dimen/default_spacing" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View File

@ -5,4 +5,6 @@
<!-- Default screen margins, per the Android Design guidelines. --> <!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen> <dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen> <dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="default_spacing">8dp</dimen>
</resources> </resources>

View File

@ -1,5 +1,5 @@
<resources> <resources>
<string name="app_name">R6S</string> <string name="app_name" translatable="false">R6S</string>
<string name="navigation_drawer_open">Open navigation drawer</string> <string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string> <string name="navigation_drawer_close">Close navigation drawer</string>

View File

@ -5,7 +5,7 @@ buildscript {
jcenter() jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:2.2.0' classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files

0
R6S/gradlew vendored Executable file → Normal file
View File