make RepoDetails scrollable and add a QR code to the bottom
Having a QR Code of the repo makes it easy for people to share the repo to someone else.
This commit is contained in:
parent
7ea294bb66
commit
46978e1086
@ -1,18 +1,24 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<RelativeLayout
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/repoView"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="fill_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_height="fill_parent"
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:focusable="true"
|
|
||||||
android:focusableInTouchMode="true"
|
|
||||||
android:paddingTop="@dimen/padding_top"
|
android:paddingTop="@dimen/padding_top"
|
||||||
android:paddingLeft="@dimen/padding_side"
|
android:paddingLeft="@dimen/padding_side"
|
||||||
android:paddingStart="@dimen/padding_side"
|
android:paddingStart="@dimen/padding_side"
|
||||||
android:paddingRight="@dimen/padding_side"
|
android:paddingRight="@dimen/padding_side"
|
||||||
android:paddingEnd="@dimen/padding_side">
|
android:paddingEnd="@dimen/padding_side">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/repoView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -133,3 +139,11 @@
|
|||||||
android:layout_below="@id/text_not_yet_updated"/>
|
android:layout_below="@id/text_not_yet_updated"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/qr_code"
|
||||||
|
android:src="@drawable/swap_qr_example"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
|
@ -26,12 +26,15 @@ import org.fdroid.fdroid.FDroidApp;
|
|||||||
import org.fdroid.fdroid.NfcHelper;
|
import org.fdroid.fdroid.NfcHelper;
|
||||||
import org.fdroid.fdroid.NfcNotEnabledActivity;
|
import org.fdroid.fdroid.NfcNotEnabledActivity;
|
||||||
import org.fdroid.fdroid.ProgressListener;
|
import org.fdroid.fdroid.ProgressListener;
|
||||||
|
import org.fdroid.fdroid.QrGenAsyncTask;
|
||||||
import org.fdroid.fdroid.R;
|
import org.fdroid.fdroid.R;
|
||||||
import org.fdroid.fdroid.UpdateService;
|
import org.fdroid.fdroid.UpdateService;
|
||||||
import org.fdroid.fdroid.Utils;
|
import org.fdroid.fdroid.Utils;
|
||||||
import org.fdroid.fdroid.data.Repo;
|
import org.fdroid.fdroid.data.Repo;
|
||||||
import org.fdroid.fdroid.data.RepoProvider;
|
import org.fdroid.fdroid.data.RepoProvider;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
public class RepoDetailsActivity extends ActionBarActivity {
|
public class RepoDetailsActivity extends ActionBarActivity {
|
||||||
private static final String TAG = "RepoDetailsActivity";
|
private static final String TAG = "RepoDetailsActivity";
|
||||||
|
|
||||||
@ -111,6 +114,11 @@ public class RepoDetailsActivity extends ActionBarActivity {
|
|||||||
performUpdate();
|
performUpdate();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Uri uri = Uri.parse(repo.address);
|
||||||
|
uri = uri.buildUpon().appendQueryParameter("fingerprint", repo.fingerprint).build();
|
||||||
|
String qrUriString = uri.toString().toUpperCase(Locale.ENGLISH);
|
||||||
|
new QrGenAsyncTask(this, R.id.qr_code).execute(uri.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@TargetApi(14)
|
@TargetApi(14)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user