UI improvements and fixes for older Android versions
This commit is contained in:
12
app/src/main/res/drawable/bg_item_selectable.xml
Normal file
12
app/src/main/res/drawable/bg_item_selectable.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/bg_item_selected_state"
|
||||
android:state_pressed="true"
|
||||
android:state_selected="true"
|
||||
android:state_activated="true"
|
||||
android:state_active="true"
|
||||
android:state_checked="true"
|
||||
android:state_focused="true"
|
||||
android:state_single="true"/>
|
||||
<item android:drawable="@drawable/bg_item_normal_state" />
|
||||
</selector>
|
@ -1,21 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2015 Haruki Hasegawa
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<color android:color="@color/bg_item_selected_state"/>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/colorAccent" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:left="4dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/colorAccentLight" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
|
8
app/src/main/res/drawable/bg_white.xml
Normal file
8
app/src/main/res/drawable/bg_white.xml
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/md_white_1000" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
@ -1,59 +1,61 @@
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center">
|
||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:elevation="4dp"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||
tools:ignore="UnusedAttribute"/>
|
||||
tools:ignore="UnusedAttribute"
|
||||
tools:layout_editor_absoluteX="8dp" />
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_below="@id/toolbar"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal"
|
||||
android:showDividers="middle"
|
||||
tools:context=".MainActivity">
|
||||
<android.support.constraint.Guideline
|
||||
android:id="@+id/guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.382" />
|
||||
|
||||
<!--
|
||||
This layout is a two-pane layout for the Messages
|
||||
master/detail flow.
|
||||
-->
|
||||
<FrameLayout
|
||||
android:id="@+id/item_list"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_below="@+id/toolbar"
|
||||
android:background="@drawable/bg_white"
|
||||
android:elevation="2dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/guideline"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/toolbar"
|
||||
tools:context=".MessageListActivity"
|
||||
tools:layout="@layout/fragment_message_list"
|
||||
tools:ignore="UnusedAttribute" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/item_list"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
tools:context=".MessageListActivity"
|
||||
tools:layout="@layout/fragment_message_list"/>
|
||||
<FrameLayout
|
||||
android:id="@+id/message_detail_container"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_below="@+id/toolbar"
|
||||
android:layout_weight="2"
|
||||
android:background="@drawable/bg_white"
|
||||
android:padding="8dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/guideline"
|
||||
app:layout_constraintTop_toBottomOf="@+id/toolbar"
|
||||
tools:ignore="InconsistentLayout"
|
||||
tools:layout="@layout/fragment_message_detail" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:background="@color/bg_item_selected_state">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/message_detail_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="16dp"
|
||||
android:background="@color/contentBackground"
|
||||
android:elevation="2dp"
|
||||
tools:layout="@layout/fragment_message_detail"
|
||||
tools:ignore="InconsistentLayout,UnusedAttribute"/>
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
@ -1,5 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Copyright 2015 Christian Basler
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -16,9 +15,10 @@
|
||||
-->
|
||||
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_item_selectable">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
@ -28,7 +28,7 @@
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@color/colorAccent"
|
||||
tools:ignore="ContentDescription"/>
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
@ -44,7 +44,7 @@
|
||||
android:paddingTop="0dp"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textStyle="bold"
|
||||
tools:text="Name"/>
|
||||
tools:text="Name" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/address"
|
||||
@ -57,6 +57,6 @@
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
tools:text="BM-2cW0000000000000000000000000000000"/>
|
||||
tools:text="BM-2cW0000000000000000000000000000000" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ListView
|
||||
android:id="@id/android:list"
|
||||
@ -13,8 +13,9 @@
|
||||
android:layout_alignParentTop="true"
|
||||
android:choiceMode="singleChoice"
|
||||
android:clipToPadding="false"
|
||||
android:listSelector="@drawable/bg_item_selected_state"
|
||||
android:paddingBottom="88dp"
|
||||
android:scrollbarStyle="outsideOverlay"/>
|
||||
android:scrollbarStyle="outsideOverlay" />
|
||||
|
||||
<io.github.yavski.fabspeeddial.FabSpeedDial
|
||||
android:id="@+id/fab_add_contact"
|
||||
@ -27,5 +28,5 @@
|
||||
app:elevation="8dp"
|
||||
app:fabDrawable="@drawable/ic_action_add_contact"
|
||||
app:fabGravity="bottom_end"
|
||||
app:fabMenu="@menu/fab_address"/>
|
||||
app:fabMenu="@menu/fab_address" />
|
||||
</RelativeLayout>
|
||||
|
11
app/src/main/res/layout/fragment_status.xml
Normal file
11
app/src/main/res/layout/fragment_status.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fontFamily="monospace"
|
||||
android:padding="16dp"
|
||||
android:text=""
|
||||
android:textIsSelectable="true"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
@ -19,8 +19,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/activatedBackgroundIndicator">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/avatar"
|
||||
|
@ -6,6 +6,7 @@
|
||||
<color name="colorPrimaryDarkText">#DEFFFFFF</color>
|
||||
<color name="colorPrimaryLight">#FFECB3</color>
|
||||
<color name="colorAccent">#607D8B</color>
|
||||
<color name="colorAccentLight">#d3e0e6</color>
|
||||
<color name="colorPrimaryText">#212121</color>
|
||||
<color name="colorSecondaryText">#727272</color>
|
||||
<color name="contentBackground">#FFFFFF</color>
|
||||
|
@ -5,6 +5,7 @@
|
||||
<item name="android:activatedBackgroundIndicator">@drawable/bg_item_activated</item>
|
||||
<item name="android:textColor">@color/colorPrimaryText</item>
|
||||
<item name="android:textColorSecondary">@color/colorSecondaryText</item>
|
||||
<item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
|
||||
</style>
|
||||
|
||||
<style name="CustomShowcaseTheme" parent="ShowcaseView">
|
||||
|
@ -1,14 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!--
|
||||
<ListPreference
|
||||
android:key="wifi_mode"
|
||||
android:title="@string/wifi_mode"
|
||||
android:dialogTitle="@string/wifi_mode"
|
||||
android:entries="@array/connection_modes"
|
||||
android:entryValues="@array/connection_mode_values"/>
|
||||
-->
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="wifi_only"
|
||||
android:summary="@string/wifi_only_summary"
|
||||
@ -24,7 +16,7 @@
|
||||
android:key="sync_timeout"
|
||||
android:summary="@string/sync_timeout_summary"
|
||||
android:title="@string/sync_timeout"/>
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:dependency="trusted_node"
|
||||
android:key="server_pow"
|
||||
|
Reference in New Issue
Block a user