mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-22 01:51:47 +00:00
Make DeviceFragments listview use full screen width so the over scroll indicator looks better
Summary: Make DeviceFragments listview use full screen width so the over scroll indicator looks better | {F6466146} | {F6466147} | | before | after | Test Plan: Apply patch and notice that the layout of the list elements has remained the same as before Reviewers: #kde_connect, nicolasfella Reviewed By: #kde_connect, nicolasfella Subscribers: nicolasfella, kdeconnect Tags: #kde_connect Differential Revision: https://phabricator.kde.org/D17456
This commit is contained in:
parent
87ec4f2078
commit
15ff0fca2b
BIN
res/drawable-hdpi/divider_horizontal_holo_light.9.png
Normal file
BIN
res/drawable-hdpi/divider_horizontal_holo_light.9.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 164 B |
6
res/drawable-v21/list_divider.xml
Normal file
6
res/drawable-v21/list_divider.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<inset
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:drawable="?attr/dividerHorizontal"
|
||||
android:insetLeft="16dp"
|
||||
android:insetRight="16dp"/>
|
6
res/drawable/list_divider.xml
Normal file
6
res/drawable/list_divider.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<inset
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:drawable="@drawable/divider_horizontal_holo_light"
|
||||
android:insetLeft="16dp"
|
||||
android:insetRight="16dp"/>
|
@ -5,7 +5,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/activity_vertical_margin"
|
||||
tools:context="org.kde.kdeconnect.UserInterface.DeviceFragment">
|
||||
|
||||
<LinearLayout
|
||||
@ -13,14 +12,15 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="gone"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/activity_vertical_margin"
|
||||
android:visibility="gone">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/pair_progress"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone" />
|
||||
android:visibility="gone"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pair_message"
|
||||
@ -28,7 +28,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dip"
|
||||
android:text="@string/device_not_paired"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/pair_button"
|
||||
@ -36,7 +36,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/button_round"
|
||||
android:text="@string/request_pairing"
|
||||
android:textColor="@android:color/white" />
|
||||
android:textColor="@android:color/white"/>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
@ -54,7 +54,7 @@
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/button_round"
|
||||
android:text="@string/pairing_accept"
|
||||
android:textColor="@android:color/white" />
|
||||
android:textColor="@android:color/white"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/reject_button"
|
||||
@ -64,7 +64,7 @@
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/button_round"
|
||||
android:text="@string/pairing_reject"
|
||||
android:textColor="@android:color/white" />
|
||||
android:textColor="@android:color/white"/>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
@ -73,9 +73,10 @@
|
||||
android:id="@+id/error_message_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center"
|
||||
android:visibility="gone" >
|
||||
android:orientation="horizontal"
|
||||
android:padding="16dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<android.support.v7.widget.AppCompatImageView
|
||||
android:id="@+id/error_message_icon"
|
||||
@ -106,7 +107,7 @@
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/on_data_message"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:visibility="gone" />
|
||||
android:visibility="gone"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@ -115,6 +116,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true"
|
||||
tools:context=".DeviceActivity" />
|
||||
|
||||
android:divider="@drawable/list_divider"
|
||||
tools:context=".DeviceActivity"
|
||||
tools:listitem="@layout/list_item_with_icon_entry"/>
|
||||
</LinearLayout>
|
||||
|
@ -1,60 +1,59 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/abc_list_selector_holo_dark"
|
||||
android:baselineAligned="false"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||
android:orientation="horizontal"
|
||||
android:paddingEnd="?android:attr/scrollbarSize"
|
||||
android:paddingLeft="12dip"
|
||||
android:paddingRight="?android:attr/scrollbarSize"
|
||||
android:paddingStart="12dip">
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp">
|
||||
|
||||
<android.support.v7.widget.AppCompatImageView
|
||||
android:id="@+id/list_item_entry_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:contentDescription="@string/device_icon_description"
|
||||
app:tint="?attr/colorControlNormal"
|
||||
android:src="@drawable/ic_device_laptop" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/list_item_entry_title"
|
||||
<android.support.v7.widget.AppCompatImageView
|
||||
android:id="@+id/list_item_entry_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="8dip"
|
||||
android:layout_marginStart="8dip"
|
||||
android:ellipsize="marquee"
|
||||
android:fadingEdge="horizontal"
|
||||
android:singleLine="true"
|
||||
android:text=""
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_marginStart="12dp"
|
||||
android:contentDescription="@string/device_icon_description"
|
||||
android:src="@drawable/ic_device_laptop"
|
||||
app:tint="?attr/colorControlNormal"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/list_item_entry_summary"
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dip"
|
||||
android:layout_marginStart="8dip"
|
||||
android:singleLine="true"
|
||||
android:text=""
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#CC2222"
|
||||
android:visibility="gone" />
|
||||
android:orientation="vertical">
|
||||
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/list_item_entry_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="8dip"
|
||||
android:layout_marginStart="8dip"
|
||||
android:ellipsize="marquee"
|
||||
android:fadingEdge="horizontal"
|
||||
android:singleLine="true"
|
||||
android:text=""
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"/>
|
||||
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/list_item_entry_summary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="8dip"
|
||||
android:layout_marginStart="8dip"
|
||||
android:singleLine="true"
|
||||
android:text=""
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#CC2222"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
@ -42,6 +42,7 @@ import org.kde.kdeconnect.Helpers.NetworkHelper;
|
||||
import org.kde.kdeconnect.Helpers.SecurityHelpers.SslHelper;
|
||||
import org.kde.kdeconnect.Plugins.Plugin;
|
||||
import org.kde.kdeconnect.UserInterface.List.CustomItem;
|
||||
import org.kde.kdeconnect.UserInterface.List.FailedPluginListItem;
|
||||
import org.kde.kdeconnect.UserInterface.List.ListAdapter;
|
||||
import org.kde.kdeconnect.UserInterface.List.PluginItem;
|
||||
import org.kde.kdeconnect.UserInterface.List.SmallEntryItem;
|
||||
@ -378,9 +379,9 @@ public class DeviceFragment extends Fragment {
|
||||
|
||||
TextView header = new TextView(mActivity);
|
||||
header.setPadding(
|
||||
0,
|
||||
((int) (16 * getResources().getDisplayMetrics().density)),
|
||||
((int) (28 * getResources().getDisplayMetrics().density)),
|
||||
0,
|
||||
((int) (16 * getResources().getDisplayMetrics().density)),
|
||||
((int) (8 * getResources().getDisplayMetrics().density))
|
||||
);
|
||||
header.setOnClickListener(null);
|
||||
|
@ -17,18 +17,17 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.kde.kdeconnect.UserInterface;
|
||||
package org.kde.kdeconnect.UserInterface.List;
|
||||
|
||||
import org.kde.kdeconnect.Plugins.Plugin;
|
||||
import org.kde.kdeconnect.UserInterface.List.SmallEntryItem;
|
||||
|
||||
class FailedPluginListItem extends SmallEntryItem {
|
||||
public class FailedPluginListItem extends SmallEntryItem {
|
||||
|
||||
interface Action {
|
||||
public interface Action {
|
||||
void action(Plugin plugin);
|
||||
}
|
||||
|
||||
FailedPluginListItem(Plugin plugin, Action action) {
|
||||
public FailedPluginListItem(Plugin plugin, Action action) {
|
||||
super(plugin.getDisplayName(), (view) -> action.action(plugin));
|
||||
}
|
||||
}
|
@ -45,6 +45,12 @@ public class SmallEntryItem implements ListAdapter.Item {
|
||||
@Override
|
||||
public View inflateView(LayoutInflater layoutInflater) {
|
||||
View v = layoutInflater.inflate(android.R.layout.simple_list_item_1, null);
|
||||
v.setPadding(
|
||||
((int) (28 * layoutInflater.getContext().getResources().getDisplayMetrics().density)),
|
||||
0,
|
||||
((int) (28 * layoutInflater.getContext().getResources().getDisplayMetrics().density)),
|
||||
0
|
||||
);
|
||||
|
||||
TextView titleView = v.findViewById(android.R.id.text1);
|
||||
if (titleView != null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user