2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-30 13:47:41 +00:00

Trying to make the device label more easily clickable

This commit is contained in:
Albert Vaca 2015-11-12 08:14:12 -08:00
parent d20cf1696b
commit f4db8e6160
2 changed files with 13 additions and 6 deletions

View File

@ -2,7 +2,6 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="160dp"
android:padding="16dp"
android:background="@drawable/drawer_header"
android:orientation="vertical"
android:gravity="bottom">
@ -14,8 +13,11 @@
android:text="KDE Connect"
android:textColor="#FFF"
android:textStyle="bold"
android:paddingBottom="4dp"
android:layout_above="@+id/device_name"
android:id="@+id/kdeconnect_label"
android:paddingLeft="16dp"
android:paddingTop="8dp"
android:paddingRight="48dp"
/>
<TextView
@ -23,12 +25,15 @@
android:layout_height="wrap_content"
android:text="My device"
android:id="@+id/device_name"
android:layout_marginBottom="8dp"
android:layout_marginBottom="0dp"
android:textColor="#fff"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
/>
android:paddingBottom="16dp"
android:paddingTop="4dp"
android:paddingRight="48dp"
android:paddingLeft="16dp" />
<!--
<ImageView

View File

@ -66,12 +66,14 @@ public class MaterialActivity extends AppCompatActivity {
TextView nameView = (TextView) mDrawerLayout.findViewById(R.id.device_name);
nameView.setText(deviceName);
nameView.setOnClickListener(new View.OnClickListener() {
View.OnClickListener renameListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
renameDevice();
}
});
};
mDrawerLayout.findViewById(R.id.kdeconnect_label).setOnClickListener(renameListener);
mDrawerLayout.findViewById(R.id.device_name).setOnClickListener(renameListener);
mNavigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
@Override