mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-09-01 06:35:09 +00:00
Merge branch '0.9'
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="org.kde.kdeconnect_tp"
|
package="org.kde.kdeconnect_tp"
|
||||||
android:versionCode="907"
|
android:versionCode="908"
|
||||||
android:versionName="0.9c">
|
android:versionName="0.9d">
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="9"
|
<uses-sdk android:minSdkVersion="9"
|
||||||
android:targetSdkVersion="22" />
|
android:targetSdkVersion="22" />
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="160dp"
|
android:layout_height="160dp"
|
||||||
android:padding="16dp"
|
|
||||||
android:background="@drawable/drawer_header"
|
android:background="@drawable/drawer_header"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:gravity="bottom">
|
android:gravity="bottom">
|
||||||
@@ -14,8 +13,13 @@
|
|||||||
android:text="KDE Connect"
|
android:text="KDE Connect"
|
||||||
android:textColor="#FFF"
|
android:textColor="#FFF"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:paddingBottom="4dp"
|
|
||||||
android:layout_above="@+id/device_name"
|
android:layout_above="@+id/device_name"
|
||||||
|
android:id="@+id/kdeconnect_label"
|
||||||
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingStart="16dp"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:paddingRight="48dp"
|
||||||
|
android:paddingEnd="48dp"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -23,12 +27,17 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="My device"
|
android:text="My device"
|
||||||
android:id="@+id/device_name"
|
android:id="@+id/device_name"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="0dp"
|
||||||
android:textColor="#fff"
|
android:textColor="#fff"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
/>
|
android:paddingBottom="16dp"
|
||||||
|
android:paddingTop="4dp"
|
||||||
|
android:paddingRight="48dp"
|
||||||
|
android:paddingEnd="48dp"
|
||||||
|
android:paddingStart="16dp"
|
||||||
|
android:paddingLeft="16dp" />
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<ImageView
|
<ImageView
|
||||||
|
@@ -77,12 +77,14 @@ public class MaterialActivity extends AppCompatActivity {
|
|||||||
TextView nameView = (TextView) mDrawerLayout.findViewById(R.id.device_name);
|
TextView nameView = (TextView) mDrawerLayout.findViewById(R.id.device_name);
|
||||||
nameView.setText(deviceName);
|
nameView.setText(deviceName);
|
||||||
|
|
||||||
nameView.setOnClickListener(new View.OnClickListener() {
|
View.OnClickListener renameListener = new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
renameDevice();
|
renameDevice();
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
mDrawerLayout.findViewById(R.id.kdeconnect_label).setOnClickListener(renameListener);
|
||||||
|
mDrawerLayout.findViewById(R.id.device_name).setOnClickListener(renameListener);
|
||||||
|
|
||||||
mNavigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
|
mNavigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -258,11 +260,17 @@ public class MaterialActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void renameDevice() {
|
public void renameDevice() {
|
||||||
final TextView nameView = (TextView) mDrawerLayout.findViewById(R.id.device_name);
|
final TextView nameView = (TextView) mDrawerLayout.findViewById(R.id.device_name);
|
||||||
final EditText deviceNameEdit = new EditText(MaterialActivity.this);
|
final EditText deviceNameEdit = new EditText(MaterialActivity.this);
|
||||||
String deviceName = DeviceHelper.getDeviceName(MaterialActivity.this);
|
String deviceName = DeviceHelper.getDeviceName(MaterialActivity.this);
|
||||||
deviceNameEdit.setText(deviceName);
|
deviceNameEdit.setText(deviceName);
|
||||||
|
deviceNameEdit.setPadding(
|
||||||
|
((int) (18 * getResources().getDisplayMetrics().density)),
|
||||||
|
((int) (16 * getResources().getDisplayMetrics().density)),
|
||||||
|
((int) (18 * getResources().getDisplayMetrics().density)),
|
||||||
|
((int) (12 * getResources().getDisplayMetrics().density))
|
||||||
|
);
|
||||||
new AlertDialog.Builder(MaterialActivity.this)
|
new AlertDialog.Builder(MaterialActivity.this)
|
||||||
.setView(deviceNameEdit)
|
.setView(deviceNameEdit)
|
||||||
.setPositiveButton(R.string.device_rename_confirm, new DialogInterface.OnClickListener() {
|
.setPositiveButton(R.string.device_rename_confirm, new DialogInterface.OnClickListener() {
|
||||||
|
Reference in New Issue
Block a user