Skip to content
Open

Dev #14

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
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
134 changes: 109 additions & 25 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 17 additions & 2 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.nicue.onetwo"
minSdkVersion 19
targetSdkVersion 27
targetSdkVersion 28
versionCode 15
versionName "1.1.7"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -24,8 +24,8 @@ dependencies {
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
testImplementation 'junit:junit:4.12'
}
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
android:name=".MainActivity"
android:windowSoftInputMode="adjustPan|adjustResize|stateAlwaysHidden|stateHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />j
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />k
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Expand Down
19 changes: 19 additions & 0 deletions app/src/main/java/com/nicue/onetwo/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
private Toolbar toolbar;
private Switch mSwitch;
private Button rollAllButton;
private Button resetButton;
private Button addTimerButton;
private Button delTimerButton;
private TextView actionTitle;
Expand All @@ -52,11 +53,13 @@ protected void onCreate(Bundle savedInstanceState) {
// Set a Toolbar to replace the ActionBar.
toolbar = (Toolbar) findViewById(R.id.toolbar);
mSwitch = (Switch) toolbar.findViewById(R.id.toolbar_switch);
resetButton = (Button) toolbar.findViewById(R.id.reset_chosen_button);
rollAllButton = (Button) toolbar.findViewById(R.id.roll_dices_button);
addTimerButton = (Button) toolbar.findViewById(R.id.add_timer_button);
delTimerButton = (Button) toolbar.findViewById(R.id.remove_timer_button);
actionTitle = (TextView) toolbar.findViewById(R.id.custom_toolbar_title);
mSwitch.setOnCheckedChangeListener(this);
resetButton.setOnClickListener(this);
rollAllButton.setOnClickListener(this);
addTimerButton.setOnClickListener(this);
delTimerButton.setOnClickListener(this);
Expand Down Expand Up @@ -98,6 +101,7 @@ protected void onCreate(Bundle savedInstanceState) {

}else if (tempFragment instanceof ChooserFragment){
currentTitleString = getString(R.string.menu_chooser);
resetButton.setVisibility(View.VISIBLE);
mSwitch.setVisibility(View.VISIBLE);

}else if (tempFragment instanceof TimerFragment){
Expand Down Expand Up @@ -153,6 +157,10 @@ public void onClick(View v) {
case R.id.remove_timer_button:
delTimer();
break;
case R.id.reset_chosen_button:
resetChooser();
break;

}
}

Expand All @@ -179,20 +187,23 @@ public void selectDrawerItem(MenuItem menuItem) {
case R.id.nav_first_fragment:
fragmentClass = CounterFragment.class;
mSwitch.setVisibility(View.INVISIBLE);
resetButton.setVisibility(View.INVISIBLE);
rollAllButton.setVisibility(View.INVISIBLE);
delTimerButton.setVisibility(View.INVISIBLE);
addTimerButton.setVisibility(View.INVISIBLE);
break;
case R.id.nav_second_fragment:
fragmentClass = DiceFragment.class;
mSwitch.setVisibility(View.INVISIBLE);
resetButton.setVisibility(View.INVISIBLE);
rollAllButton.setVisibility(View.VISIBLE);
delTimerButton.setVisibility(View.INVISIBLE);
addTimerButton.setVisibility(View.INVISIBLE);
break;
case R.id.nav_third_fragment:
fragmentClass = ChooserFragment.class;
mSwitch.setVisibility(View.VISIBLE);
resetButton.setVisibility(View.VISIBLE);
rollAllButton.setVisibility(View.INVISIBLE);
delTimerButton.setVisibility(View.INVISIBLE);
addTimerButton.setVisibility(View.INVISIBLE);
Expand All @@ -201,6 +212,7 @@ public void selectDrawerItem(MenuItem menuItem) {
case R.id.nav_fourth_fragment:
fragmentClass = TimerFragment.class;
mSwitch.setVisibility(View.INVISIBLE);
resetButton.setVisibility(View.INVISIBLE);
rollAllButton.setVisibility(View.INVISIBLE);
delTimerButton.setVisibility(View.VISIBLE);
addTimerButton.setVisibility(View.VISIBLE);
Expand Down Expand Up @@ -271,6 +283,13 @@ public void delTimer(){
}
}

public void resetChooser(){
Fragment tempFragment = getSupportFragmentManager().findFragmentById(R.id.m_content);

if (tempFragment instanceof ChooserFragment){
((ChooserFragment) tempFragment).resetChooser();
}
}
public void loadTimersData(){
Fragment tempFragment2 = getSupportFragmentManager().findFragmentById(R.id.m_content);

Expand Down
Loading