From e246f77d59ffd4d2317349853b2732fc8a3ac287 Mon Sep 17 00:00:00 2001 From: Vivek Singh Bhadauria Date: Sat, 12 Oct 2019 13:09:04 +0530 Subject: [PATCH 1/2] removed unnecessary files from repo and added them to .gitignore --- .gitignore | 2 + .idea/.name | 1 - .idea/codeStyles/Project.xml | 116 -------------------------- .idea/compiler.xml | 23 ----- .idea/copyright/profiles_settings.xml | 3 - .idea/encodings.xml | 5 -- .idea/misc.xml | 9 -- .idea/modules.xml | 10 --- .idea/runConfigurations.xml | 12 --- .idea/scopes/scope_settings.xml | 5 -- app/app.iml | 98 ---------------------- caverna.iml | 19 ----- 12 files changed, 2 insertions(+), 301 deletions(-) delete mode 100644 .idea/.name delete mode 100644 .idea/codeStyles/Project.xml delete mode 100644 .idea/compiler.xml delete mode 100644 .idea/copyright/profiles_settings.xml delete mode 100644 .idea/encodings.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/runConfigurations.xml delete mode 100644 .idea/scopes/scope_settings.xml delete mode 100644 app/app.iml delete mode 100644 caverna.iml diff --git a/.gitignore b/.gitignore index ec2da97..d6d4fdc 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,5 @@ /build /app/*.apk +.idea +*.iml \ No newline at end of file diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index 4acd69f..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -caverna \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml deleted file mode 100644 index 681f41a..0000000 --- a/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - -
- - - - xmlns:android - - ^$ - - - -
-
- - - - xmlns:.* - - ^$ - - - BY_NAME - -
-
- - - - .*:id - - http://schemas.android.com/apk/res/android - - - -
-
- - - - .*:name - - http://schemas.android.com/apk/res/android - - - -
-
- - - - name - - ^$ - - - -
-
- - - - style - - ^$ - - - -
-
- - - - .* - - ^$ - - - BY_NAME - -
-
- - - - .* - - http://schemas.android.com/apk/res/android - - - ANDROID_ATTRIBUTE_ORDER - -
-
- - - - .* - - .* - - - BY_NAME - -
-
-
-
-
-
\ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index 217af47..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml deleted file mode 100644 index e7bedf3..0000000 --- a/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index e206d70..0000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 0ffc241..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 67c4407..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 7f68460..0000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml deleted file mode 100644 index 922003b..0000000 --- a/.idea/scopes/scope_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/app.iml b/app/app.iml deleted file mode 100644 index 0e720d4..0000000 --- a/app/app.iml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/caverna.iml b/caverna.iml deleted file mode 100644 index 22e730a..0000000 --- a/caverna.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file From 236475b5e77339da3ea2be87ded8229aa85ea63c Mon Sep 17 00:00:00 2001 From: Vivek Singh Bhadauria Date: Sat, 12 Oct 2019 13:16:49 +0530 Subject: [PATCH 2/2] Fixed some lint issues --- .../main/java/ch/quazz/caverna/ui/GameActivity.java | 10 +++++----- .../java/ch/quazz/caverna/ui/GamePlayerAdapter.java | 6 ++++-- .../java/ch/quazz/caverna/widget/CountingInput.java | 4 +++- app/src/main/res/layout-land/activity_game.xml | 3 +-- app/src/main/res/layout-land/fragment_bonus.xml | 3 +-- app/src/main/res/values/strings.xml | 3 +++ 6 files changed, 17 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/ch/quazz/caverna/ui/GameActivity.java b/app/src/main/java/ch/quazz/caverna/ui/GameActivity.java index 617786e..e345126 100644 --- a/app/src/main/java/ch/quazz/caverna/ui/GameActivity.java +++ b/app/src/main/java/ch/quazz/caverna/ui/GameActivity.java @@ -76,7 +76,7 @@ protected void onCreate(Bundle savedInstanceState) { dbHelper = new CavernaDbHelper(this); } - ListView players = (ListView)findViewById(R.id.game_player_list); + ListView players = findViewById(R.id.game_player_list); registerForContextMenu(players); players.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override @@ -129,7 +129,7 @@ protected void onResume() { scoringPadAdapter = new GamePlayerAdapter(this); scoringPadAdapter.setScoringPad(scoringPad); - ListView listView = (ListView)findViewById(R.id.game_player_list); + ListView listView = findViewById(R.id.game_player_list); listView.setAdapter(scoringPadAdapter); } @@ -172,14 +172,14 @@ private void createScoringPad(List scoringPad) { int padding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics()); - TableLayout table = (TableLayout)findViewById(R.id.game_scoring_pad); + TableLayout table = findViewById(R.id.game_scoring_pad); table.removeAllViews(); // add rows TableRow players = new TableRow(this); players.setBackgroundResource(R.color.blue); TextView title = new TextView(this); - title.setText("Player"); + title.setText(getString(R.string.player)); players.addView(title); table.addView(players); @@ -204,7 +204,7 @@ private void createScoringPad(List scoringPad) { for (Row row : rows) { TextView points = new TextView(this); - points.setGravity(Gravity.RIGHT); + points.setGravity(Gravity.END); points.setText(String.valueOf(sheet.score(row.category))); points.setPadding(padding, 0, padding, 0); if (row.category == ScoreSheet.Category.Total) { diff --git a/app/src/main/java/ch/quazz/caverna/ui/GamePlayerAdapter.java b/app/src/main/java/ch/quazz/caverna/ui/GamePlayerAdapter.java index f29d214..37689e0 100644 --- a/app/src/main/java/ch/quazz/caverna/ui/GamePlayerAdapter.java +++ b/app/src/main/java/ch/quazz/caverna/ui/GamePlayerAdapter.java @@ -55,7 +55,7 @@ public long getItemId(int position) { public View getView(int position, View convertView, ViewGroup parent) { View view; if (convertView == null) { - LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = inflater != null ? inflater.inflate(R.layout.list_item, parent, false) : null; } else { view = convertView; @@ -63,7 +63,9 @@ public View getView(int position, View convertView, ViewGroup parent) { ScoreSheet sheet = scoringPad.get(position); TextView title = view != null ? (TextView) view.findViewById(R.id.item_text) : null; - title.setText((sheet.player) + " " + sheet.name); + if (title != null) { + title.setText(context.getResources().getString(R.string.score_sheet_title, sheet.player, sheet.name)); + } return view; } } diff --git a/app/src/main/java/ch/quazz/caverna/widget/CountingInput.java b/app/src/main/java/ch/quazz/caverna/widget/CountingInput.java index e2438c4..c1b7abe 100644 --- a/app/src/main/java/ch/quazz/caverna/widget/CountingInput.java +++ b/app/src/main/java/ch/quazz/caverna/widget/CountingInput.java @@ -24,9 +24,11 @@ public class CountingInput extends LinearLayout { private final SeekBar countSlider; private OnCountChangeListener listener; + private Context context; public CountingInput(Context context, AttributeSet attrs) { super(context, attrs); + this.context = context; LayoutInflater.from(context).inflate(R.layout.counting_input, this, true); @@ -105,6 +107,6 @@ public void onStopTrackingTouch(SeekBar seekBar) { } private void updateText() { - countText.setText(label + ": " + (count)); + countText.setText(context.getResources().getString(R.string.count_text, label, count)); } } diff --git a/app/src/main/res/layout-land/activity_game.xml b/app/src/main/res/layout-land/activity_game.xml index c7a97c5..d84d8b2 100644 --- a/app/src/main/res/layout-land/activity_game.xml +++ b/app/src/main/res/layout-land/activity_game.xml @@ -19,8 +19,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" /> - - Delete Players count + Player + %1$s: %2$d + %1$d %2$s