Remove update button
It's confusing because it does not update the repo details view.
This commit is contained in:
parent
dbd69444f1
commit
f5906f320f
@ -102,13 +102,6 @@
|
|||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:paddingTop="@dimen/form_label_top"/>
|
android:paddingTop="@dimen/form_label_top"/>
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/btn_update"
|
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:text="@string/repo_update"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"/>
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/qr_code"
|
android:id="@+id/qr_code"
|
||||||
android:src="@drawable/swap_qr_example"
|
android:src="@drawable/swap_qr_example"
|
||||||
|
@ -2,11 +2,6 @@
|
|||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/menu_update"
|
|
||||||
android:icon="@drawable/ic_refresh_white"
|
|
||||||
android:title="@string/repo_update"
|
|
||||||
app:showAsAction="always|withText" />
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/menu_delete"
|
android:id="@+id/menu_delete"
|
||||||
android:icon="@drawable/ic_delete_white"
|
android:icon="@drawable/ic_delete_white"
|
||||||
@ -18,4 +13,4 @@
|
|||||||
android:title="@string/enable_nfc_send"
|
android:title="@string/enable_nfc_send"
|
||||||
app:showAsAction="ifRoom|withText" />
|
app:showAsAction="ifRoom|withText" />
|
||||||
|
|
||||||
</menu>
|
</menu>
|
||||||
|
@ -2,7 +2,6 @@ package org.fdroid.fdroid.views;
|
|||||||
|
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.ContentValues;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@ -21,7 +20,6 @@ import android.text.TextUtils;
|
|||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
@ -66,7 +64,6 @@ public class RepoDetailsActivity extends ActionBarActivity {
|
|||||||
*/
|
*/
|
||||||
private static final int[] HIDE_IF_EXISTS = {
|
private static final int[] HIDE_IF_EXISTS = {
|
||||||
R.id.text_not_yet_updated,
|
R.id.text_not_yet_updated,
|
||||||
R.id.btn_update
|
|
||||||
};
|
};
|
||||||
private Repo repo;
|
private Repo repo;
|
||||||
private long repoId;
|
private long repoId;
|
||||||
@ -109,14 +106,6 @@ public class RepoDetailsActivity extends ActionBarActivity {
|
|||||||
TextView inputUrl = (TextView) findViewById(R.id.input_repo_url);
|
TextView inputUrl = (TextView) findViewById(R.id.input_repo_url);
|
||||||
inputUrl.setText(repo.address);
|
inputUrl.setText(repo.address);
|
||||||
|
|
||||||
Button update = (Button) repoView.findViewById(R.id.btn_update);
|
|
||||||
update.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
performUpdate();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
Uri uri = Uri.parse(repo.address);
|
Uri uri = Uri.parse(repo.address);
|
||||||
uri = uri.buildUpon().appendQueryParameter("fingerprint", repo.fingerprint).build();
|
uri = uri.buildUpon().appendQueryParameter("fingerprint", repo.fingerprint).build();
|
||||||
String qrUriString = uri.toString().toUpperCase(Locale.ENGLISH);
|
String qrUriString = uri.toString().toUpperCase(Locale.ENGLISH);
|
||||||
@ -207,9 +196,6 @@ public class RepoDetailsActivity extends ActionBarActivity {
|
|||||||
case android.R.id.home:
|
case android.R.id.home:
|
||||||
NavUtils.navigateUpFromSameTask(this);
|
NavUtils.navigateUpFromSameTask(this);
|
||||||
return true;
|
return true;
|
||||||
case R.id.menu_update:
|
|
||||||
performUpdate();
|
|
||||||
return true;
|
|
||||||
case R.id.menu_delete:
|
case R.id.menu_delete:
|
||||||
promptForDelete();
|
promptForDelete();
|
||||||
return true;
|
return true;
|
||||||
@ -328,19 +314,6 @@ public class RepoDetailsActivity extends ActionBarActivity {
|
|||||||
lastUpdated.setText(lastUpdate);
|
lastUpdated.setText(lastUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* When an update is performed, notify the listener so that the repo
|
|
||||||
* list can be updated. We will perform the update ourselves though.
|
|
||||||
*/
|
|
||||||
private void performUpdate() {
|
|
||||||
// Ensure repo is enabled before updating...
|
|
||||||
ContentValues values = new ContentValues(1);
|
|
||||||
values.put(RepoProvider.DataColumns.IN_USE, 1);
|
|
||||||
RepoProvider.Helper.update(this, repo, values);
|
|
||||||
|
|
||||||
UpdateService.updateRepoNow(repo.address, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void promptForDelete() {
|
private void promptForDelete() {
|
||||||
new AlertDialog.Builder(this)
|
new AlertDialog.Builder(this)
|
||||||
.setTitle(R.string.repo_confirm_delete_title)
|
.setTitle(R.string.repo_confirm_delete_title)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user