1
0
Fork 0
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:
George Venios 2015-09-06 03:31:25 +01:00
parent 97039cf337
commit c924578e14
6 changed files with 23 additions and 28 deletions

View file

@ -356,12 +356,10 @@ public class FolderFragment extends Fragment
private void addEmptyDeviceListView() {
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(WRAP_CONTENT, dp(48, getActivity()));
// 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 contentInset = getResources().getDimensionPixelOffset(R.dimen.abc_action_bar_content_inset_material);
int textPadding = dp(4, getActivity());
setMarginStart(params, dividerInset + textPadding);
setMarginEnd(params, contentInset + textPadding);
setMarginStart(params, dividerInset);
setMarginEnd(params, contentInset);
TextView emptyView = new TextView(mDevicesContainer.getContext());
emptyView.setGravity(CENTER_VERTICAL);
emptyView.setText(R.string.devices_list_empty);

View file

@ -17,7 +17,7 @@
<TextView
android:id="@+id/drawerActionSettings"
style="@style/Widget.Syncthing.TextView.DrawerAction"
style="@style/Widget.Syncthing.TextView.Label"
android:layout_width="match_parent"
android:layout_height="48dp"
android:drawableLeft="@drawable/ic_settings_black_24dp"
@ -39,7 +39,7 @@
<LinearLayout
android:id="@+id/deviceIdContainer"
style="@style/Widget.Syncthing.TextView.DrawerAction"
style="@style/Widget.Syncthing.TextView.Label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
@ -67,7 +67,7 @@
<TextView
android:id="@+id/drawerActionWebGui"
style="@style/Widget.Syncthing.TextView.DrawerAction"
style="@style/Widget.Syncthing.TextView.Label"
android:layout_width="match_parent"
android:layout_height="48dp"
android:drawableLeft="@drawable/ic_web_black_24dp"
@ -76,7 +76,7 @@
<TextView
android:id="@+id/drawerActionDonate"
style="@style/Widget.Syncthing.TextView.DrawerAction"
style="@style/Widget.Syncthing.TextView.Label"
android:layout_width="match_parent"
android:layout_height="48dp"
android:drawableLeft="@drawable/ic_attach_money_black_24dp"
@ -85,7 +85,7 @@
<TextView
android:id="@+id/drawerActionExit"
style="@style/Widget.Syncthing.TextView.DrawerAction"
style="@style/Widget.Syncthing.TextView.Label"
android:layout_width="match_parent"
android:layout_height="48dp"
android:drawableLeft="@drawable/ic_close_black_24dp"

View file

@ -17,7 +17,7 @@
<EditText
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_height="56dp"
android:drawableLeft="@drawable/ic_vpn_key_black_24dp"
@ -26,7 +26,7 @@
<TextView
android:id="@+id/directory"
style="@style/Widget.Syncthing.TextView.Label"
style="@style/Widget.Syncthing.TextView.Label.Folder"
android:layout_width="match_parent"
android:layout_height="56dp"
android:drawableLeft="@drawable/ic_folder_black_24dp"
@ -40,7 +40,7 @@
android:orientation="vertical">
<TextView
style="@style/Widget.Syncthing.TextView.Label"
style="@style/Widget.Syncthing.TextView.Label.Folder"
android:layout_width="match_parent"
android:layout_height="56dp"
android:drawableLeft="@drawable/ic_device_hub_black_24dp"
@ -50,7 +50,7 @@
<android.support.v7.widget.SwitchCompat
android:id="@+id/master"
style="@style/Widget.Syncthing.TextView.Label"
style="@style/Widget.Syncthing.TextView.Label.Folder"
android:layout_width="match_parent"
android:layout_height="56dp"
android:checked="false"
@ -66,7 +66,7 @@
android:orientation="horizontal">
<TextView
style="@style/Widget.Syncthing.TextView.Label"
style="@style/Widget.Syncthing.TextView.Label.Folder"
android:layout_width="0dp"
android:layout_height="56dp"
android:layout_weight="1"

View file

@ -1,10 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.SwitchCompat xmlns:android="http://schemas.android.com/apk/res/android"
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_height="48dp"
android:layout_marginLeft="@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"
tools:ignore="RtlHardcoded,RtlSymmetry" />

View file

@ -8,4 +8,5 @@
android:minHeight="?android:actionBarSize"
android:background="?colorPrimary"
android:elevation="@dimen/toolbar_elevation"
app:titleMarginStart="16dp"
app:theme="@style/ThemeOverlay.Syncthing.Toolbar" />

View file

@ -18,33 +18,27 @@
<style name="Widget.Syncthing.TextView.Label" parent="@android:style/Widget.TextView">
<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: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:paddingRight">@dimen/abc_action_bar_content_inset_material</item>
</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>
</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:imeOptions">actionDone</item>
<item name="android:inputType">textVisiblePassword</item>
</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" >
<item name="android:paddingLeft">4dp</item>
<item name="android:minHeight">48dp</item>