mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-12-23 19:31:30 +00:00
Fixed grid/keyline alignment.
This commit is contained in:
parent
97039cf337
commit
c924578e14
6 changed files with 23 additions and 28 deletions
|
@ -356,12 +356,10 @@ public class FolderFragment extends Fragment
|
||||||
private void addEmptyDeviceListView() {
|
private void addEmptyDeviceListView() {
|
||||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(WRAP_CONTENT, dp(48, getActivity()));
|
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(WRAP_CONTENT, dp(48, getActivity()));
|
||||||
// 72dp margin to align with dividers
|
// 72dp margin to align with dividers
|
||||||
// 4dp additional margin to align with the rest of the items
|
|
||||||
int dividerInset = getResources().getDimensionPixelOffset(R.dimen.material_divider_inset);
|
int dividerInset = getResources().getDimensionPixelOffset(R.dimen.material_divider_inset);
|
||||||
int contentInset = getResources().getDimensionPixelOffset(R.dimen.abc_action_bar_content_inset_material);
|
int contentInset = getResources().getDimensionPixelOffset(R.dimen.abc_action_bar_content_inset_material);
|
||||||
int textPadding = dp(4, getActivity());
|
setMarginStart(params, dividerInset);
|
||||||
setMarginStart(params, dividerInset + textPadding);
|
setMarginEnd(params, contentInset);
|
||||||
setMarginEnd(params, contentInset + textPadding);
|
|
||||||
TextView emptyView = new TextView(mDevicesContainer.getContext());
|
TextView emptyView = new TextView(mDevicesContainer.getContext());
|
||||||
emptyView.setGravity(CENTER_VERTICAL);
|
emptyView.setGravity(CENTER_VERTICAL);
|
||||||
emptyView.setText(R.string.devices_list_empty);
|
emptyView.setText(R.string.devices_list_empty);
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/drawerActionSettings"
|
android:id="@+id/drawerActionSettings"
|
||||||
style="@style/Widget.Syncthing.TextView.DrawerAction"
|
style="@style/Widget.Syncthing.TextView.Label"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:drawableLeft="@drawable/ic_settings_black_24dp"
|
android:drawableLeft="@drawable/ic_settings_black_24dp"
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/deviceIdContainer"
|
android:id="@+id/deviceIdContainer"
|
||||||
style="@style/Widget.Syncthing.TextView.DrawerAction"
|
style="@style/Widget.Syncthing.TextView.Label"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="4dp"
|
||||||
|
@ -67,7 +67,7 @@
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/drawerActionWebGui"
|
android:id="@+id/drawerActionWebGui"
|
||||||
style="@style/Widget.Syncthing.TextView.DrawerAction"
|
style="@style/Widget.Syncthing.TextView.Label"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:drawableLeft="@drawable/ic_web_black_24dp"
|
android:drawableLeft="@drawable/ic_web_black_24dp"
|
||||||
|
@ -76,7 +76,7 @@
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/drawerActionDonate"
|
android:id="@+id/drawerActionDonate"
|
||||||
style="@style/Widget.Syncthing.TextView.DrawerAction"
|
style="@style/Widget.Syncthing.TextView.Label"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:drawableLeft="@drawable/ic_attach_money_black_24dp"
|
android:drawableLeft="@drawable/ic_attach_money_black_24dp"
|
||||||
|
@ -85,7 +85,7 @@
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/drawerActionExit"
|
android:id="@+id/drawerActionExit"
|
||||||
style="@style/Widget.Syncthing.TextView.DrawerAction"
|
style="@style/Widget.Syncthing.TextView.Label"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:drawableLeft="@drawable/ic_close_black_24dp"
|
android:drawableLeft="@drawable/ic_close_black_24dp"
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/id"
|
android:id="@+id/id"
|
||||||
style="@style/Widget.Syncthing.TextView.Field"
|
style="@style/Widget.Syncthing.TextView.Label.Folder.Field"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="56dp"
|
android:layout_height="56dp"
|
||||||
android:drawableLeft="@drawable/ic_vpn_key_black_24dp"
|
android:drawableLeft="@drawable/ic_vpn_key_black_24dp"
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/directory"
|
android:id="@+id/directory"
|
||||||
style="@style/Widget.Syncthing.TextView.Label"
|
style="@style/Widget.Syncthing.TextView.Label.Folder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="56dp"
|
android:layout_height="56dp"
|
||||||
android:drawableLeft="@drawable/ic_folder_black_24dp"
|
android:drawableLeft="@drawable/ic_folder_black_24dp"
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
style="@style/Widget.Syncthing.TextView.Label"
|
style="@style/Widget.Syncthing.TextView.Label.Folder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="56dp"
|
android:layout_height="56dp"
|
||||||
android:drawableLeft="@drawable/ic_device_hub_black_24dp"
|
android:drawableLeft="@drawable/ic_device_hub_black_24dp"
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
|
|
||||||
<android.support.v7.widget.SwitchCompat
|
<android.support.v7.widget.SwitchCompat
|
||||||
android:id="@+id/master"
|
android:id="@+id/master"
|
||||||
style="@style/Widget.Syncthing.TextView.Label"
|
style="@style/Widget.Syncthing.TextView.Label.Folder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="56dp"
|
android:layout_height="56dp"
|
||||||
android:checked="false"
|
android:checked="false"
|
||||||
|
@ -66,7 +66,7 @@
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
style="@style/Widget.Syncthing.TextView.Label"
|
style="@style/Widget.Syncthing.TextView.Label.Folder"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="56dp"
|
android:layout_height="56dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.v7.widget.SwitchCompat xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.v7.widget.SwitchCompat xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
style="@style/Widget.Syncthing.TextView.Label.DeviceList"
|
style="@style/Widget.Syncthing.TextView.Label.Folder.DeviceList"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="48dp"
|
||||||
android:layout_marginLeft="@dimen/material_divider_inset"
|
android:layout_marginLeft="@dimen/material_divider_inset"
|
||||||
android:layout_marginStart="@dimen/material_divider_inset"
|
android:layout_marginStart="@dimen/material_divider_inset"
|
||||||
|
android:layout_marginRight="@dimen/abc_action_bar_content_inset_material"
|
||||||
|
android:layout_marginEnd="@dimen/abc_action_bar_content_inset_material"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
|
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
|
||||||
tools:ignore="RtlHardcoded,RtlSymmetry" />
|
tools:ignore="RtlHardcoded,RtlSymmetry" />
|
|
@ -8,4 +8,5 @@
|
||||||
android:minHeight="?android:actionBarSize"
|
android:minHeight="?android:actionBarSize"
|
||||||
android:background="?colorPrimary"
|
android:background="?colorPrimary"
|
||||||
android:elevation="@dimen/toolbar_elevation"
|
android:elevation="@dimen/toolbar_elevation"
|
||||||
|
app:titleMarginStart="16dp"
|
||||||
app:theme="@style/ThemeOverlay.Syncthing.Toolbar" />
|
app:theme="@style/ThemeOverlay.Syncthing.Toolbar" />
|
|
@ -18,33 +18,27 @@
|
||||||
|
|
||||||
<style name="Widget.Syncthing.TextView.Label" parent="@android:style/Widget.TextView">
|
<style name="Widget.Syncthing.TextView.Label" parent="@android:style/Widget.TextView">
|
||||||
<item name="android:background">?selectableItemBackground</item>
|
<item name="android:background">?selectableItemBackground</item>
|
||||||
<item name="android:drawablePadding">24dp</item>
|
<item name="android:drawablePadding">32dp</item>
|
||||||
<item name="android:gravity">start|center_vertical</item>
|
<item name="android:gravity">start|center_vertical</item>
|
||||||
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Body1</item>
|
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Body1</item>
|
||||||
<item name="android:textColor">?attr/editTextColor</item>
|
|
||||||
<item name="android:paddingLeft">@dimen/abc_action_bar_content_inset_material</item>
|
<item name="android:paddingLeft">@dimen/abc_action_bar_content_inset_material</item>
|
||||||
<item name="android:paddingRight">@dimen/abc_action_bar_content_inset_material</item>
|
<item name="android:paddingRight">@dimen/abc_action_bar_content_inset_material</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Widget.Syncthing.TextView.Label.DeviceList">
|
<style name="Widget.Syncthing.TextView.Label.Folder">
|
||||||
|
<item name="android:textColor">?attr/editTextColor</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="Widget.Syncthing.TextView.Label.Folder.DeviceList">
|
||||||
<item name="android:paddingLeft">4dp</item>
|
<item name="android:paddingLeft">4dp</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Widget.Syncthing.TextView.Field" parent="Widget.Syncthing.TextView.Label">
|
<style name="Widget.Syncthing.TextView.Label.Folder.Field">
|
||||||
<item name="android:background">@null</item>
|
<item name="android:background">@null</item>
|
||||||
<item name="android:imeOptions">actionDone</item>
|
<item name="android:imeOptions">actionDone</item>
|
||||||
<item name="android:inputType">textVisiblePassword</item>
|
<item name="android:inputType">textVisiblePassword</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Widget.Syncthing.TextView.DrawerAction">
|
|
||||||
<item name="android:background">?selectableItemBackground</item>
|
|
||||||
<item name="android:drawablePadding">16dp</item>
|
|
||||||
<item name="android:gravity">center_vertical</item>
|
|
||||||
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Body1</item>
|
|
||||||
<item name="android:paddingLeft">@dimen/abc_action_bar_content_inset_material</item>
|
|
||||||
<item name="android:paddingRight">@dimen/abc_action_bar_content_inset_material</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="Widget.Syncthing.Switch" parent="@style/Widget.AppCompat.CompoundButton.Switch" >
|
<style name="Widget.Syncthing.Switch" parent="@style/Widget.AppCompat.CompoundButton.Switch" >
|
||||||
<item name="android:paddingLeft">4dp</item>
|
<item name="android:paddingLeft">4dp</item>
|
||||||
<item name="android:minHeight">48dp</item>
|
<item name="android:minHeight">48dp</item>
|
||||||
|
|
Loading…
Reference in a new issue