2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-30 21:55:10 +00:00

Merge branch '0.9'

This commit is contained in:
Albert Vaca
2015-11-12 08:23:26 -08:00
3 changed files with 26 additions and 9 deletions

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.kde.kdeconnect_tp"
android:versionCode="907"
android:versionName="0.9c">
android:versionCode="908"
android:versionName="0.9d">
<uses-sdk android:minSdkVersion="9"
android:targetSdkVersion="22" />

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,13 @@
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:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingRight="48dp"
android:paddingEnd="48dp"
/>
<TextView
@@ -23,12 +27,17 @@
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:paddingEnd="48dp"
android:paddingStart="16dp"
android:paddingLeft="16dp" />
<!--
<ImageView

View File

@@ -77,12 +77,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
@@ -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 EditText deviceNameEdit = new EditText(MaterialActivity.this);
String deviceName = DeviceHelper.getDeviceName(MaterialActivity.this);
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)
.setView(deviceNameEdit)
.setPositiveButton(R.string.device_rename_confirm, new DialogInterface.OnClickListener() {