Skip to content

Commit

Permalink
Merge pull request #1782 from crankycoder/features/1779-appcompat-ui-fix
Browse files Browse the repository at this point in the history
Features/1779 appcompat ui fix
  • Loading branch information
crankycoder committed Apr 26, 2016
2 parents bfff196 + 249dc48 commit 912129a
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 7 deletions.
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ dependencies {
// libraries, because they support a wide range of Android versions and
// provide APIs for recommended user interface patterns.

compile "com.android.support:support-v4:21.0.+"
compile 'com.android.support:appcompat-v7:19.1.0'
compile "com.android.support:support-v4:23.0.0"
compile 'com.android.support:appcompat-v7:23.0.0'

compile('org.simpleframework:simple-xml:2.7.1') {
exclude group: 'stax', module: 'stax-api'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
Expand Down Expand Up @@ -136,11 +136,15 @@ private void init() {

getSupportActionBar().setTitle(getString(R.string.app_name));

getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setDisplayUseLogoEnabled(true);
getSupportActionBar().setLogo(R.drawable.ic_actionbar);

mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mDrawerToggle = new ActionBarDrawerToggle(
this, /* host Activity */
mDrawerLayout, /* DrawerLayout object */
R.drawable.ic_drawer, /* nav drawer icon to replace 'Up' caret */
R.string.drawer_open, /* "open drawer" description */
R.string.drawer_close /* "close drawer" description */
) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed android/src/main/res/drawable-hdpi/ic_drawer.png
Binary file not shown.
Binary file removed android/src/main/res/drawable-mdpi/ic_drawer.png
Binary file not shown.
Binary file removed android/src/main/res/drawable-xhdpi/ic_drawer.png
Binary file not shown.
3 changes: 3 additions & 0 deletions android/src/main/res/layout/button_bg.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
</shape>
3 changes: 3 additions & 0 deletions android/src/main/res/layout/button_bg_pressed.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
</shape>
7 changes: 7 additions & 0 deletions android/src/main/res/layout/button_selector.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_focused="true" android:state_pressed="true"
android:drawable="@layout/button_bg_pressed" />
<item android:state_focused="false" android:state_pressed="true"
android:drawable="@layout/button_bg_pressed" />
<item android:drawable="@layout/button_bg" /> </selector>
6 changes: 3 additions & 3 deletions android/src/main/res/layout/fragment_metrics_drawer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -296,15 +296,15 @@

<Button
android:id="@+id/button_change_power_setting"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@layout/button_selector"
android:layout_above="@+id/map_info_title"
android:layout_alignEnd="@+id/cell_plus_wifi_layout"
android:layout_alignRight="@+id/cell_plus_wifi_layout"
android:layout_marginBottom="4dp"
android:minHeight="0dp"
android:text="@string/change_power_saving" />
android:text="@string/change_power_saving"
android:layout_marginBottom="10dp" />

<TextView
android:id="@+id/map_info_title"
Expand Down

0 comments on commit 912129a

Please sign in to comment.