Some fixes
This commit is contained in:
parent
bcfc4dc9bd
commit
db320409c4
|
@ -92,10 +92,10 @@ public class AccountReportActivity extends BaseActivity implements OnAdminAction
|
|||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
actionBar.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(AccountReportActivity.this, R.color.cyanea_primary)));
|
||||
LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
|
||||
assert inflater != null;
|
||||
View view = inflater.inflate(R.layout.simple_bar, new LinearLayout(getApplicationContext()), false);
|
||||
view.setBackground(new ColorDrawable(ContextCompat.getColor(AccountReportActivity.this, R.color.cyanea_primary)));
|
||||
actionBar.setCustomView(view, new ActionBar.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
||||
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
|
||||
ImageView toolbar_close = actionBar.getCustomView().findViewById(R.id.toolbar_close);
|
||||
|
|
|
@ -2026,13 +2026,8 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
}
|
||||
if (apiResponse.getInstance() == null || apiResponse.getInstance().getVersion() == null || apiResponse.getInstance().getVersion().trim().length() == 0)
|
||||
return;
|
||||
|
||||
instanceClass = apiResponse.getInstance();
|
||||
poll_limits = apiResponse.getInstance().getPoll_limits();
|
||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = sharedpreferences.edit();
|
||||
editor.putString(Helper.INSTANCE_VERSION + userId + instance, apiResponse.getInstance().getVersion());
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -68,7 +68,6 @@ import app.fedilab.android.client.API;
|
|||
import app.fedilab.android.client.APIResponse;
|
||||
import app.fedilab.android.client.Entities.Account;
|
||||
import app.fedilab.android.client.Entities.Error;
|
||||
import app.fedilab.android.client.Entities.Version;
|
||||
import app.fedilab.android.helper.Helper;
|
||||
import app.fedilab.android.interfaces.OnRetrieveAccountInterface;
|
||||
import app.fedilab.android.interfaces.OnUpdateCredentialInterface;
|
||||
|
@ -157,16 +156,9 @@ public class EditProfileActivity extends BaseActivity implements OnRetrieveAccou
|
|||
set_header_picture_overlay = findViewById(R.id.set_header_picture_overlay);
|
||||
set_lock_account = findViewById(R.id.set_lock_account);
|
||||
set_sensitive_content = findViewById(R.id.set_sensitive_content);
|
||||
String instanceVersion = sharedpreferences.getString(Helper.INSTANCE_VERSION + userId + instance, null);
|
||||
Version currentVersion = new Version(instanceVersion);
|
||||
Version minVersion = new Version("2.3");
|
||||
if (currentVersion.compareTo(minVersion) > 0) {
|
||||
set_lock_account.setVisibility(View.VISIBLE);
|
||||
set_sensitive_content.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
set_lock_account.setVisibility(View.GONE);
|
||||
set_sensitive_content.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
set_lock_account.setVisibility(View.VISIBLE);
|
||||
set_sensitive_content.setVisibility(View.VISIBLE);
|
||||
|
||||
if (account.getSocial().toUpperCase().equals("MASTODON")) {
|
||||
custom_fields_container.setVisibility(View.VISIBLE);
|
||||
|
|
|
@ -153,7 +153,6 @@ public class MainApplication extends MultiDexApplication {
|
|||
ACRA.init(this, ACRABuilder);
|
||||
}
|
||||
|
||||
|
||||
//Initialize upload service
|
||||
UploadService.NAMESPACE = BuildConfig.APPLICATION_ID;
|
||||
initNetCipher(this);
|
||||
|
|
|
@ -136,7 +136,6 @@ import app.fedilab.android.client.Entities.Notification;
|
|||
import app.fedilab.android.client.Entities.Results;
|
||||
import app.fedilab.android.client.Entities.Status;
|
||||
import app.fedilab.android.client.Entities.StoredStatus;
|
||||
import app.fedilab.android.client.Entities.Version;
|
||||
import app.fedilab.android.drawers.AccountsSearchAdapter;
|
||||
import app.fedilab.android.drawers.EmojisSearchAdapter;
|
||||
import app.fedilab.android.drawers.SliderAdapter;
|
||||
|
@ -1246,35 +1245,25 @@ public class PixelfedComposeActivity extends BaseActivity implements UploadStatu
|
|||
if ((time[0] - new Date().getTime()) < 60000) {
|
||||
Toasty.warning(getApplicationContext(), getString(R.string.toot_scheduled_date), Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||
String instanceVersion = sharedpreferences.getString(Helper.INSTANCE_VERSION + userId + instance, null);
|
||||
Version currentVersion = new Version(instanceVersion);
|
||||
Version minVersion = new Version("2.7");
|
||||
if (currentVersion.compareTo(minVersion) == 1 || currentVersion.equals(minVersion)) {
|
||||
AlertDialog.Builder builderSingle = new AlertDialog.Builder(PixelfedComposeActivity.this, style);
|
||||
builderSingle.setTitle(getString(R.string.choose_schedule));
|
||||
builderSingle.setNegativeButton(R.string.device_schedule, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
deviceSchedule(time[0]);
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
builderSingle.setPositiveButton(R.string.server_schedule, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final DialogInterface dialog, int which) {
|
||||
int offset = TimeZone.getDefault().getRawOffset();
|
||||
calendar.add(Calendar.MILLISECOND, -offset);
|
||||
final String date = Helper.dateToString(new Date(calendar.getTimeInMillis()));
|
||||
serverSchedule(date);
|
||||
}
|
||||
});
|
||||
builderSingle.show();
|
||||
|
||||
} else {
|
||||
deviceSchedule(time[0]);
|
||||
}
|
||||
|
||||
AlertDialog.Builder builderSingle = new AlertDialog.Builder(PixelfedComposeActivity.this, style);
|
||||
builderSingle.setTitle(getString(R.string.choose_schedule));
|
||||
builderSingle.setNegativeButton(R.string.device_schedule, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
deviceSchedule(time[0]);
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
builderSingle.setPositiveButton(R.string.server_schedule, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final DialogInterface dialog, int which) {
|
||||
int offset = TimeZone.getDefault().getRawOffset();
|
||||
calendar.add(Calendar.MILLISECOND, -offset);
|
||||
final String date = Helper.dateToString(new Date(calendar.getTimeInMillis()));
|
||||
serverSchedule(date);
|
||||
}
|
||||
});
|
||||
builderSingle.show();
|
||||
alertDialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,6 @@ import app.fedilab.android.helper.Helper;
|
|||
*/
|
||||
|
||||
public class PrivacyActivity extends BaseActivity {
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -49,9 +48,6 @@ public class PrivacyActivity extends BaseActivity {
|
|||
case Helper.THEME_LIGHT:
|
||||
setTheme(R.style.AppTheme_Fedilab);
|
||||
break;
|
||||
case Helper.THEME_DARK:
|
||||
setTheme(R.style.AppThemeDark);
|
||||
break;
|
||||
case Helper.THEME_BLACK:
|
||||
setTheme(R.style.AppThemeBlack);
|
||||
break;
|
||||
|
@ -71,12 +67,7 @@ public class PrivacyActivity extends BaseActivity {
|
|||
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
|
||||
ImageView toolbar_close = actionBar.getCustomView().findViewById(R.id.toolbar_close);
|
||||
TextView toolbar_title = actionBar.getCustomView().findViewById(R.id.toolbar_title);
|
||||
toolbar_close.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
toolbar_close.setOnClickListener(v -> finish());
|
||||
toolbar_title.setText(R.string.action_privacy);
|
||||
}
|
||||
setContentView(R.layout.activity_privacy);
|
||||
|
@ -85,12 +76,10 @@ public class PrivacyActivity extends BaseActivity {
|
|||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home:
|
||||
finish();
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
if (item.getItemId() == android.R.id.home) {
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -165,7 +165,6 @@ import app.fedilab.android.client.Entities.Status;
|
|||
import app.fedilab.android.client.Entities.StoredStatus;
|
||||
import app.fedilab.android.client.Entities.Suggestion;
|
||||
import app.fedilab.android.client.Entities.Tag;
|
||||
import app.fedilab.android.client.Entities.Version;
|
||||
import app.fedilab.android.client.GNUAPI;
|
||||
import app.fedilab.android.client.HttpsConnection;
|
||||
import app.fedilab.android.drawers.AccountsReplyAdapter;
|
||||
|
@ -1371,14 +1370,7 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
|||
showRemove(imageView.getId());
|
||||
return false;
|
||||
});
|
||||
String instanceVersion = sharedpreferences.getString(Helper.INSTANCE_VERSION + userId + instance, null);
|
||||
if (instanceVersion != null) {
|
||||
Version currentVersion = new Version(instanceVersion);
|
||||
Version minVersion = new Version("2.0");
|
||||
if (currentVersion.compareTo(minVersion) > 0 || currentVersion.equals(minVersion)) {
|
||||
imageView.setOnClickListener(view -> showAddDescription(attachment));
|
||||
}
|
||||
}
|
||||
imageView.setOnClickListener(view -> showAddDescription(attachment));
|
||||
attachments.add(attachment);
|
||||
addBorder();
|
||||
if (attachments.size() < max_media_count)
|
||||
|
@ -2034,29 +2026,19 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
|||
if ((time[0] - new Date().getTime()) < 60000) {
|
||||
Toasty.warning(getApplicationContext(), getString(R.string.toot_scheduled_date), Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
SharedPreferences sharedpreferences1 = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||
String instanceVersion = sharedpreferences1.getString(Helper.INSTANCE_VERSION + userId + instance, null);
|
||||
Version currentVersion = new Version(instanceVersion);
|
||||
Version minVersion = new Version("2.7");
|
||||
if (currentVersion.compareTo(minVersion) > 0 || currentVersion.equals(minVersion)) {
|
||||
AlertDialog.Builder builderSingle1 = new AlertDialog.Builder(TootActivity.this, style);
|
||||
builderSingle1.setTitle(getString(R.string.choose_schedule));
|
||||
builderSingle1.setNegativeButton(R.string.device_schedule, (dialog, which) -> {
|
||||
deviceSchedule(time[0]);
|
||||
dialog.dismiss();
|
||||
});
|
||||
builderSingle1.setPositiveButton(R.string.server_schedule, (dialog, which) -> {
|
||||
int offset = TimeZone.getDefault().getRawOffset();
|
||||
calendar.add(Calendar.MILLISECOND, -offset);
|
||||
final String date = Helper.dateToString(new Date(calendar.getTimeInMillis()));
|
||||
serverSchedule(date);
|
||||
});
|
||||
builderSingle1.show();
|
||||
|
||||
} else {
|
||||
AlertDialog.Builder builderSingle1 = new AlertDialog.Builder(TootActivity.this, style);
|
||||
builderSingle1.setTitle(getString(R.string.choose_schedule));
|
||||
builderSingle1.setNegativeButton(R.string.device_schedule, (dialog, which) -> {
|
||||
deviceSchedule(time[0]);
|
||||
}
|
||||
|
||||
dialog.dismiss();
|
||||
});
|
||||
builderSingle1.setPositiveButton(R.string.server_schedule, (dialog, which) -> {
|
||||
int offset = TimeZone.getDefault().getRawOffset();
|
||||
calendar.add(Calendar.MILLISECOND, -offset);
|
||||
final String date = Helper.dateToString(new Date(calendar.getTimeInMillis()));
|
||||
serverSchedule(date);
|
||||
});
|
||||
builderSingle1.show();
|
||||
alertDialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
@ -2255,15 +2237,11 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
|||
itemPoll.setVisible(false);
|
||||
}
|
||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||
|
||||
String instanceVersion = sharedpreferences.getString(Helper.INSTANCE_VERSION + userId + instance, null);
|
||||
Version currentVersion = new Version(instanceVersion);
|
||||
Version minVersion = new Version("2.0");
|
||||
MenuItem itemEmoji = menu.findItem(R.id.action_emoji);
|
||||
SQLiteDatabase db = Sqlite.getInstance(getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
|
||||
final List<Emojis> emojis = new CustomEmojiDAO(getApplicationContext(), db).getAllEmojis();
|
||||
//Displays button only if custom emojis
|
||||
if (emojis != null && emojis.size() > 0 && (currentVersion.compareTo(minVersion) == 0 || currentVersion.equals(minVersion))) {
|
||||
if (emojis != null && emojis.size() > 0) {
|
||||
itemEmoji.setVisible(true);
|
||||
} else {
|
||||
itemEmoji.setVisible(false);
|
||||
|
@ -3040,15 +3018,7 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
|||
});
|
||||
imageView.setTag(attachment.getId());
|
||||
imageView.setOnClickListener(view -> {
|
||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||
String instanceVersion = sharedpreferences.getString(Helper.INSTANCE_VERSION + userId + instance, null);
|
||||
if (instanceVersion != null) {
|
||||
Version currentVersion = new Version(instanceVersion);
|
||||
Version minVersion = new Version("2.0");
|
||||
if (currentVersion.compareTo(minVersion) > 0 || currentVersion.equals(minVersion)) {
|
||||
imageView.setOnClickListener(view1 -> showAddDescription(attachment));
|
||||
}
|
||||
}
|
||||
imageView.setOnClickListener(view1 -> showAddDescription(attachment));
|
||||
});
|
||||
imageView.setOnLongClickListener(view -> {
|
||||
showRemove(imageView.getId());
|
||||
|
@ -3191,15 +3161,7 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
|||
});
|
||||
imageView.setTag(attachment.getId());
|
||||
imageView.setOnClickListener(view -> {
|
||||
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
|
||||
String instanceVersion = sharedpreferences.getString(Helper.INSTANCE_VERSION + userId + instance, null);
|
||||
if (instanceVersion != null) {
|
||||
Version currentVersion = new Version(instanceVersion);
|
||||
Version minVersion = new Version("2.0");
|
||||
if (currentVersion.compareTo(minVersion) > 0 || currentVersion.equals(minVersion)) {
|
||||
imageView.setOnClickListener(view1 -> showAddDescription(attachment));
|
||||
}
|
||||
}
|
||||
imageView.setOnClickListener(view1 -> showAddDescription(attachment));
|
||||
});
|
||||
imageView.setOnLongClickListener(view -> {
|
||||
showRemove(imageView.getId());
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -352,7 +352,6 @@ public class Helper {
|
|||
public static final String SET_SHOW_BOOSTS = "set_show_boost";
|
||||
public static final String SET_SHOW_REPLIES = "set_show_replies";
|
||||
public static final String SET_VIDEO_NSFW = "set_video_nsfw";
|
||||
public static final String INSTANCE_VERSION = "instance_version";
|
||||
public static final String NEWS_ACCOUNT_ID = "news_account_id";
|
||||
public static final String SET_LIVE_NOTIFICATIONS = "set_live_notifications";
|
||||
public static final String SET_DELAYED_NOTIFICATIONS = "set_delayed_notifications";
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
android:layout_marginStart="@dimen/activity_horizontal_margin"
|
||||
android:layout_marginEnd="@dimen/activity_horizontal_margin"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context="app.fedilab.android.activities.AdminActivity">
|
||||
tools:context="app.fedilab.android.activities.AccountReportActivity">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appBar"
|
||||
|
|
|
@ -19,8 +19,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
|
|
|
@ -920,6 +920,7 @@
|
|||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:visibility="gone"
|
||||
android:id="@+id/status_reactions"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
Loading…
Reference in New Issue