Store instance version + changes into long click
This commit is contained in:
parent
488fe43b0e
commit
d5ddc319ee
|
@ -1293,6 +1293,10 @@ public abstract class BaseMainActivity extends AppCompatActivity
|
|||
return;
|
||||
Version currentVersion = new Version(apiResponse.getInstance().getVersion());
|
||||
Version minVersion = new Version("1.6");
|
||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||
editor.putString(Helper.INSTANCE_VERSION, apiResponse.getInstance().getVersion());
|
||||
editor.apply();
|
||||
Helper.canPin = (currentVersion.compareTo(minVersion) == 1 || currentVersion.equals(minVersion));
|
||||
}
|
||||
|
||||
|
|
|
@ -112,6 +112,7 @@ import fr.gouv.etalab.mastodon.client.Entities.Mention;
|
|||
import fr.gouv.etalab.mastodon.client.Entities.Results;
|
||||
import fr.gouv.etalab.mastodon.client.Entities.Status;
|
||||
import fr.gouv.etalab.mastodon.client.Entities.StoredStatus;
|
||||
import fr.gouv.etalab.mastodon.client.Entities.Version;
|
||||
import fr.gouv.etalab.mastodon.client.PatchBaseImageDownloader;
|
||||
import fr.gouv.etalab.mastodon.drawers.AccountsReplyAdapter;
|
||||
import fr.gouv.etalab.mastodon.drawers.AccountsSearchAdapter;
|
||||
|
@ -1023,12 +1024,26 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc
|
|||
toot_content.setSelection(selectionBefore);
|
||||
}
|
||||
toot_picture_container.addView(imageView, attachments.size(), imParams);
|
||||
imageView.setOnClickListener(new View.OnClickListener() {
|
||||
imageView.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
public boolean onLongClick(View view) {
|
||||
showRemove(imageView.getId());
|
||||
return false;
|
||||
}
|
||||
});
|
||||
String instanceVersion = sharedpreferences.getString(Helper.INSTANCE_VERSION, null);
|
||||
if( instanceVersion != null) {
|
||||
Version currentVersion = new Version(instanceVersion);
|
||||
Version minVersion = new Version("2.0");
|
||||
if (currentVersion.compareTo(minVersion) == 1 || currentVersion.equals(minVersion)) {
|
||||
imageView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
attachments.add(attachment);
|
||||
if( attachments.size() < 4)
|
||||
toot_picture.setEnabled(true);
|
||||
|
|
|
@ -217,7 +217,7 @@ public class Helper {
|
|||
public static final String SET_LED_COLOUR = "set_led_colour";
|
||||
public static final String SET_SHOW_BOOSTS = "set_show_boost";
|
||||
public static final String SET_SHOW_REPLIES = "set_show_replies";
|
||||
|
||||
public static final String INSTANCE_VERSION = "instance_version";
|
||||
|
||||
public static final int ATTACHMENT_ALWAYS = 1;
|
||||
public static final int ATTACHMENT_WIFI = 2;
|
||||
|
|
Loading…
Reference in New Issue