Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@
/build
/app/*.apk

.idea
*.iml
1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

116 changes: 0 additions & 116 deletions .idea/codeStyles/Project.xml

This file was deleted.

23 changes: 0 additions & 23 deletions .idea/compiler.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/encodings.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/misc.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/modules.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/scopes/scope_settings.xml

This file was deleted.

98 changes: 0 additions & 98 deletions app/app.iml

This file was deleted.

10 changes: 5 additions & 5 deletions app/src/main/java/ch/quazz/caverna/ui/GameActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);

}
Expand Down Expand Up @@ -172,14 +172,14 @@ private void createScoringPad(List<ScoreSheet> 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);
Expand All @@ -204,7 +204,7 @@ private void createScoringPad(List<ScoreSheet> 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) {
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/java/ch/quazz/caverna/ui/GamePlayerAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,17 @@ 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;
}

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;
}
}
4 changes: 3 additions & 1 deletion app/src/main/java/ch/quazz/caverna/widget/CountingInput.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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));
}
}
3 changes: 1 addition & 2 deletions app/src/main/res/layout-land/activity_game.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<View xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
Expand Down
Loading