Improve follow instance in profile
This commit is contained in:
parent
4e3387e214
commit
e8d79db43f
|
@ -42,7 +42,7 @@ allprojects {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ext.supportLibraryVersion = '27.1.1'
|
ext.supportLibraryVersion = '27.1.1'
|
||||||
ext.glideLibraryVersion = '4.6.1'
|
ext.glideLibraryVersion = '4.8.0'
|
||||||
ext.conscryptLibraryVersion = '1.2.0'
|
ext.conscryptLibraryVersion = '1.2.0'
|
||||||
ext.evernoteLibraryVersion = '1.3.0-alpha06'
|
ext.evernoteLibraryVersion = '1.3.0-alpha06'
|
||||||
ext.gsonLibraryVersion = '2.8.2'
|
ext.gsonLibraryVersion = '2.8.2'
|
||||||
|
|
|
@ -98,6 +98,9 @@ import fr.gouv.etalab.mastodon.sqlite.InstancesDAO;
|
||||||
import fr.gouv.etalab.mastodon.sqlite.Sqlite;
|
import fr.gouv.etalab.mastodon.sqlite.Sqlite;
|
||||||
import fr.gouv.etalab.mastodon.sqlite.TempMuteDAO;
|
import fr.gouv.etalab.mastodon.sqlite.TempMuteDAO;
|
||||||
|
|
||||||
|
import static fr.gouv.etalab.mastodon.helper.Helper.INSTANCE_NAME;
|
||||||
|
import static fr.gouv.etalab.mastodon.helper.Helper.INTENT_ACTION;
|
||||||
|
import static fr.gouv.etalab.mastodon.helper.Helper.SEARCH_INSTANCE;
|
||||||
import static fr.gouv.etalab.mastodon.helper.Helper.THEME_BLACK;
|
import static fr.gouv.etalab.mastodon.helper.Helper.THEME_BLACK;
|
||||||
import static fr.gouv.etalab.mastodon.helper.Helper.THEME_DARK;
|
import static fr.gouv.etalab.mastodon.helper.Helper.THEME_DARK;
|
||||||
import static fr.gouv.etalab.mastodon.helper.Helper.changeDrawableColor;
|
import static fr.gouv.etalab.mastodon.helper.Helper.changeDrawableColor;
|
||||||
|
@ -334,6 +337,12 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
||||||
List<String> instance = new InstancesDAO(ShowAccountActivity.this, db).getInstanceByName(finalInstanceName);
|
List<String> instance = new InstancesDAO(ShowAccountActivity.this, db).getInstanceByName(finalInstanceName);
|
||||||
if( instance != null && instance.size() > 0 ){
|
if( instance != null && instance.size() > 0 ){
|
||||||
Toast.makeText(getApplicationContext(), R.string.toast_instance_already_added,Toast.LENGTH_LONG).show();
|
Toast.makeText(getApplicationContext(), R.string.toast_instance_already_added,Toast.LENGTH_LONG).show();
|
||||||
|
Intent intent = new Intent(getApplicationContext(), InstanceFederatedActivity.class);
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putInt(INTENT_ACTION, SEARCH_INSTANCE);
|
||||||
|
bundle.putString(INSTANCE_NAME,finalInstanceName);
|
||||||
|
intent.putExtras(bundle);
|
||||||
|
startActivity(intent);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
new Thread(new Runnable(){
|
new Thread(new Runnable(){
|
||||||
|
@ -346,6 +355,12 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
||||||
final SQLiteDatabase db = Sqlite.getInstance(getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
final SQLiteDatabase db = Sqlite.getInstance(getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||||
new InstancesDAO(ShowAccountActivity.this, db).insertInstance(finalInstanceName);
|
new InstancesDAO(ShowAccountActivity.this, db).insertInstance(finalInstanceName);
|
||||||
Toast.makeText(getApplicationContext(), R.string.toast_instance_followed,Toast.LENGTH_LONG).show();
|
Toast.makeText(getApplicationContext(), R.string.toast_instance_followed,Toast.LENGTH_LONG).show();
|
||||||
|
Intent intent = new Intent(getApplicationContext(), InstanceFederatedActivity.class);
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putInt(INTENT_ACTION, SEARCH_INSTANCE);
|
||||||
|
bundle.putString(INSTANCE_NAME,finalInstanceName);
|
||||||
|
intent.putExtras(bundle);
|
||||||
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
|
|
Loading…
Reference in New Issue