designs updated to Blue TU Theme
This commit is contained in:
parent
7242345a21
commit
1a58a9b7cc
7 changed files with 115 additions and 14 deletions
|
@ -37,7 +37,7 @@
|
|||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
|
|
@ -57,8 +57,12 @@ public class SaveLoadStatistics {
|
|||
Log.e("Failed to read file","File could not be read");
|
||||
}
|
||||
infos = new HighscoreInfoContainer(t,dif);
|
||||
try {
|
||||
infos.setInfosFromFile(new String(bytes));
|
||||
result.add(infos);
|
||||
} catch (IllegalArgumentException e){
|
||||
file.delete();
|
||||
}
|
||||
result.add(infos);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -3,6 +3,10 @@ package tu_darmstadt.sudoku.ui;
|
|||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.design.widget.NavigationView;
|
||||
import android.support.v4.view.GravityCompat;
|
||||
import android.support.v4.widget.DrawerLayout;
|
||||
import android.support.v7.app.ActionBarDrawerToggle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
|
||||
|
@ -12,6 +16,7 @@ import android.support.v4.app.FragmentPagerAdapter;
|
|||
import android.support.v4.view.ViewPager;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
|
@ -31,7 +36,7 @@ import tu_darmstadt.sudoku.game.GameDifficulty;
|
|||
import tu_darmstadt.sudoku.game.GameType;
|
||||
import tu_darmstadt.sudoku.ui.view.R;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener{
|
||||
|
||||
RatingBar difficultyBar;
|
||||
TextView difficultyText;
|
||||
|
@ -104,6 +109,18 @@ public class MainActivity extends AppCompatActivity {
|
|||
editor.putBoolean("savesChanged", true);
|
||||
editor.apply();
|
||||
refreshContinueButton();
|
||||
|
||||
|
||||
// set Nav_Bar
|
||||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout_main);
|
||||
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
|
||||
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
|
||||
drawer.setDrawerListener(toggle);
|
||||
toggle.syncState();
|
||||
|
||||
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view_main);
|
||||
navigationView.setNavigationItemSelectedListener(this);
|
||||
|
||||
}
|
||||
|
||||
public void onClick(View view) {
|
||||
|
@ -179,6 +196,46 @@ public class MainActivity extends AppCompatActivity {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onNavigationItemSelected(MenuItem item) {
|
||||
// Handle navigation view item clicks here.
|
||||
int id = item.getItemId();
|
||||
|
||||
Intent intent;
|
||||
|
||||
switch(id) {
|
||||
case R.id.menu_settings_main:
|
||||
//open settings
|
||||
intent = new Intent(this,SettingsActivity.class);
|
||||
startActivity(intent);
|
||||
break;
|
||||
|
||||
case R.id.nav_highscore_main:
|
||||
// see highscore list
|
||||
|
||||
intent = new Intent(this, StatsActivity.class);
|
||||
startActivity(intent);
|
||||
break;
|
||||
|
||||
case R.id.menu_about_main:
|
||||
//open about page
|
||||
intent = new Intent(this,AboutActivity.class);
|
||||
startActivity(intent);
|
||||
break;
|
||||
|
||||
case R.id.menu_help_main:
|
||||
//open about page
|
||||
//intent = new Intent(this,HelpActivity.class);
|
||||
//startActivity(intent);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout_main);
|
||||
drawer.closeDrawer(GravityCompat.START);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle action bar item clicks here. The action bar will
|
||||
|
|
|
@ -9,9 +9,11 @@
|
|||
android:layout_height="match_parent" />
|
||||
|
||||
<android.support.design.widget.NavigationView android:id="@+id/nav_view"
|
||||
android:layout_width="wrap_content" android:layout_height="match_parent"
|
||||
android:layout_gravity="start" android:fitsSystemWindows="true"
|
||||
app:headerLayout="@layout/nav_header_game_view"
|
||||
android:layout_width="200dp" android:layout_height="match_parent"
|
||||
android:layout_gravity="start|start" android:fitsSystemWindows="true"
|
||||
android:layout_marginTop="?attr/actionBarSize"
|
||||
android:background="@color/lightblue"
|
||||
app:menu="@menu/menu_drawer" />
|
||||
<!--app:headerLayout="@layout/nav_header_game_view"-->
|
||||
|
||||
</android.support.v4.widget.DrawerLayout>
|
||||
|
|
|
@ -1,14 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.design.widget.CoordinatorLayout
|
||||
<android.support.v4.widget.DrawerLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/main_content"
|
||||
android:fitsSystemWindows="true"
|
||||
android:id="@+id/drawer_layout_main"
|
||||
tools:context="tu_darmstadt.sudoku.ui.MainActivity"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
>
|
||||
<android.support.design.widget.CoordinatorLayout
|
||||
|
||||
android:id="@+id/main_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent">
|
||||
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -16,16 +23,18 @@
|
|||
android:theme="@style/AppTheme.AppBarOverlay">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay">
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay">
|
||||
|
||||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -192,4 +201,13 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
|
||||
<android.support.design.widget.NavigationView android:id="@+id/nav_view_main"
|
||||
android:layout_width="200dp" android:layout_height="match_parent"
|
||||
android:layout_gravity="start" android:fitsSystemWindows="true"
|
||||
android:background="@color/lightblue"
|
||||
android:layout_marginTop="?attr/actionBarSize"
|
||||
app:menu="@menu/menu_drawer_main" />
|
||||
|
||||
</android.support.v4.widget.DrawerLayout>
|
19
app/src/main/res/menu/menu_drawer_main.xml
Normal file
19
app/src/main/res/menu/menu_drawer_main.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<group android:checkableBehavior="single">
|
||||
<item android:id="@+id/nav_highscore_main" android:icon="@android:drawable/ic_menu_myplaces"
|
||||
android:title="@string/menu_highscore" />
|
||||
</group>
|
||||
<group android:menuCategory="container" android:title="">
|
||||
<menu>
|
||||
<item android:id="@+id/menu_settings_main" android:icon="@android:drawable/ic_menu_manage"
|
||||
android:title="@string/menu_settings" />
|
||||
<item android:id="@+id/menu_help_main" android:icon="@android:drawable/ic_menu_help"
|
||||
android:title="@string/menu_help" />
|
||||
<item android:id="@+id/menu_about_main" android:icon="@android:drawable/ic_menu_info_details"
|
||||
android:title="@string/menu_about" />
|
||||
</menu>
|
||||
</group>
|
||||
|
||||
</menu>
|
|
@ -3,4 +3,5 @@
|
|||
(such as screen margins) for screens with more than 820dp of available width. This
|
||||
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
|
||||
<dimen name="activity_horizontal_margin">64dp</dimen>
|
||||
<dimen name="navigation_separator_vertical_padding">0dp</dimen>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue