some fixes
This commit is contained in:
parent
3427e10265
commit
1003930a1e
|
@ -71,7 +71,6 @@ import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.Timer;
|
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
@ -89,7 +88,6 @@ import app.fedilab.android.client.Entities.RemoteInstance;
|
||||||
import app.fedilab.android.client.Entities.Status;
|
import app.fedilab.android.client.Entities.Status;
|
||||||
import app.fedilab.android.client.Entities.UserNote;
|
import app.fedilab.android.client.Entities.UserNote;
|
||||||
import app.fedilab.android.client.HttpsConnection;
|
import app.fedilab.android.client.HttpsConnection;
|
||||||
import app.fedilab.android.drawers.AccountsInAListAdapter;
|
|
||||||
import app.fedilab.android.drawers.StatusListAdapter;
|
import app.fedilab.android.drawers.StatusListAdapter;
|
||||||
import app.fedilab.android.fragments.DisplayAccountsFragment;
|
import app.fedilab.android.fragments.DisplayAccountsFragment;
|
||||||
import app.fedilab.android.fragments.DisplayStatusFragment;
|
import app.fedilab.android.fragments.DisplayStatusFragment;
|
||||||
|
@ -179,9 +177,6 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
||||||
case Helper.THEME_LIGHT:
|
case Helper.THEME_LIGHT:
|
||||||
setTheme(R.style.AppTheme_NoActionBar_Fedilab);
|
setTheme(R.style.AppTheme_NoActionBar_Fedilab);
|
||||||
break;
|
break;
|
||||||
case Helper.THEME_DARK:
|
|
||||||
setTheme(R.style.AppThemeDark_NoActionBar);
|
|
||||||
break;
|
|
||||||
case Helper.THEME_BLACK:
|
case Helper.THEME_BLACK:
|
||||||
setTheme(R.style.AppThemeBlack_NoActionBar);
|
setTheme(R.style.AppThemeBlack_NoActionBar);
|
||||||
break;
|
break;
|
||||||
|
@ -200,7 +195,6 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
||||||
account_pp = findViewById(R.id.account_pp);
|
account_pp = findViewById(R.id.account_pp);
|
||||||
account_dn = findViewById(R.id.account_dn);
|
account_dn = findViewById(R.id.account_dn);
|
||||||
account_un = findViewById(R.id.account_un);
|
account_un = findViewById(R.id.account_un);
|
||||||
TextView account_type = findViewById(R.id.account_type);
|
|
||||||
account_bot = findViewById(R.id.account_bot);
|
account_bot = findViewById(R.id.account_bot);
|
||||||
addToList = null;
|
addToList = null;
|
||||||
account_pp.setBackgroundResource(R.drawable.account_pp_border);
|
account_pp.setBackgroundResource(R.drawable.account_pp_border);
|
||||||
|
@ -245,10 +239,10 @@ public class ShowAccountActivity extends BaseActivity implements OnPostActionInt
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
final ImageButton account_menu = findViewById(R.id.account_menu);
|
final ImageView account_menu = findViewById(R.id.account_menu);
|
||||||
ImageButton action_more = findViewById(R.id.action_more);
|
ImageView action_more = findViewById(R.id.action_more);
|
||||||
ImageButton reload_tabs = findViewById(R.id.reload_tabs);
|
ImageView reload_tabs = findViewById(R.id.reload_tabs);
|
||||||
ImageButton action_back = findViewById(R.id.action_back);
|
ImageView action_back = findViewById(R.id.action_back);
|
||||||
account_menu.setOnClickListener(new View.OnClickListener() {
|
account_menu.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
|
@ -294,9 +294,6 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
||||||
case Helper.THEME_LIGHT:
|
case Helper.THEME_LIGHT:
|
||||||
setTheme(R.style.AppTheme_Fedilab);
|
setTheme(R.style.AppTheme_Fedilab);
|
||||||
break;
|
break;
|
||||||
case Helper.THEME_DARK:
|
|
||||||
setTheme(R.style.AppThemeDark);
|
|
||||||
break;
|
|
||||||
case Helper.THEME_BLACK:
|
case Helper.THEME_BLACK:
|
||||||
setTheme(R.style.AppThemeBlack);
|
setTheme(R.style.AppThemeBlack);
|
||||||
break;
|
break;
|
||||||
|
@ -315,8 +312,7 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
||||||
|
|
||||||
|
|
||||||
autocomplete = false;
|
autocomplete = false;
|
||||||
if (getSupportActionBar() != null)
|
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
|
||||||
ActionBar actionBar = getSupportActionBar();
|
ActionBar actionBar = getSupportActionBar();
|
||||||
if (actionBar != null) {
|
if (actionBar != null) {
|
||||||
LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
|
LayoutInflater inflater = (LayoutInflater) this.getSystemService(LAYOUT_INFLATER_SERVICE);
|
||||||
|
@ -718,7 +714,6 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
||||||
String defaultVisibility = account.isLocked() ? "private" : "public";
|
String defaultVisibility = account.isLocked() ? "private" : "public";
|
||||||
visibility = sharedpreferences.getString(Helper.SET_TOOT_VISIBILITY + "@" + account.getAcct() + "@" + account.getInstance(), defaultVisibility);
|
visibility = sharedpreferences.getString(Helper.SET_TOOT_VISIBILITY + "@" + account.getAcct() + "@" + account.getInstance(), defaultVisibility);
|
||||||
}
|
}
|
||||||
assert visibility != null;
|
|
||||||
switch (visibility) {
|
switch (visibility) {
|
||||||
case "public":
|
case "public":
|
||||||
toot_visibility.setImageResource(R.drawable.ic_public_toot);
|
toot_visibility.setImageResource(R.drawable.ic_public_toot);
|
||||||
|
@ -812,14 +807,12 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
if (ContextCompat.checkSelfPermission(TootActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) !=
|
||||||
if (ContextCompat.checkSelfPermission(TootActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) !=
|
PackageManager.PERMISSION_GRANTED) {
|
||||||
PackageManager.PERMISSION_GRANTED) {
|
ActivityCompat.requestPermissions(TootActivity.this,
|
||||||
ActivityCompat.requestPermissions(TootActivity.this,
|
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
|
||||||
new String[]{Manifest.permission.READ_EXTERNAL_STORAGE},
|
MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE);
|
||||||
MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE);
|
return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Intent intent;
|
Intent intent;
|
||||||
intent = new Intent(Intent.ACTION_GET_CONTENT);
|
intent = new Intent(Intent.ACTION_GET_CONTENT);
|
||||||
|
@ -832,9 +825,7 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
||||||
startActivityForResult(intent, PICK_IMAGE);
|
startActivityForResult(intent, PICK_IMAGE);
|
||||||
} else {
|
} else {
|
||||||
intent.setType("image/* video/* audio/mpeg audio/opus audio/flac audio/wav audio/ogg");
|
intent.setType("image/* video/* audio/mpeg audio/opus audio/flac audio/wav audio/ogg");
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
|
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
|
||||||
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
|
|
||||||
}
|
|
||||||
Intent pickIntent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
|
Intent pickIntent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
|
||||||
Intent chooserIntent = Intent.createChooser(intent, getString(R.string.toot_select_image));
|
Intent chooserIntent = Intent.createChooser(intent, getString(R.string.toot_select_image));
|
||||||
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent[]{pickIntent});
|
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent[]{pickIntent});
|
||||||
|
@ -1698,7 +1689,6 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||||
input.setText(Html.fromHtml(content, Html.FROM_HTML_MODE_LEGACY));
|
input.setText(Html.fromHtml(content, Html.FROM_HTML_MODE_LEGACY));
|
||||||
else
|
else
|
||||||
//noinspection deprecation
|
|
||||||
input.setText(Html.fromHtml(content));
|
input.setText(Html.fromHtml(content));
|
||||||
alert.setPositiveButton(R.string.close, new DialogInterface.OnClickListener() {
|
alert.setPositiveButton(R.string.close, new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int whichButton) {
|
public void onClick(DialogInterface dialog, int whichButton) {
|
||||||
|
@ -2457,11 +2447,7 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
||||||
@Override
|
@Override
|
||||||
public void onResourceReady(@NonNull Bitmap resource, Transition<? super Bitmap> transition) {
|
public void onResourceReady(@NonNull Bitmap resource, Transition<? super Bitmap> transition) {
|
||||||
media_picture.setImageBitmap(resource);
|
media_picture.setImageBitmap(resource);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
media_picture.setImageAlpha(60);
|
||||||
media_picture.setImageAlpha(60);
|
|
||||||
} else {
|
|
||||||
media_picture.setAlpha(60);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -3523,23 +3509,21 @@ public class TootActivity extends BaseActivity implements UploadStatusDelegate,
|
||||||
initialTootVisibility = 1;
|
initialTootVisibility = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (settingsVisibility != null) {
|
switch (settingsVisibility) {
|
||||||
switch (settingsVisibility) {
|
case "public":
|
||||||
case "public":
|
ownerTootVisibility = 4;
|
||||||
ownerTootVisibility = 4;
|
break;
|
||||||
break;
|
case "unlisted":
|
||||||
case "unlisted":
|
ownerTootVisibility = 3;
|
||||||
ownerTootVisibility = 3;
|
break;
|
||||||
break;
|
case "private":
|
||||||
case "private":
|
visibility = "private";
|
||||||
visibility = "private";
|
ownerTootVisibility = 2;
|
||||||
ownerTootVisibility = 2;
|
break;
|
||||||
break;
|
case "direct":
|
||||||
case "direct":
|
visibility = "direct";
|
||||||
visibility = "direct";
|
ownerTootVisibility = 1;
|
||||||
ownerTootVisibility = 1;
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
int tootVisibility;
|
int tootVisibility;
|
||||||
if (ownerTootVisibility >= initialTootVisibility) {
|
if (ownerTootVisibility >= initialTootVisibility) {
|
||||||
|
|
|
@ -81,7 +81,8 @@
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintStart_toEndOf="@id/account_pp"
|
app:layout_constraintStart_toEndOf="@id/account_pp"
|
||||||
app:layout_constraintTop_toBottomOf="@id/banner_pp" />
|
app:layout_constraintTop_toBottomOf="@id/banner_pp"
|
||||||
|
android:contentDescription="@string/make_an_action" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/header_edit_profile"
|
android:id="@+id/header_edit_profile"
|
||||||
|
@ -94,7 +95,8 @@
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintStart_toEndOf="@id/account_pp"
|
app:layout_constraintStart_toEndOf="@id/account_pp"
|
||||||
app:layout_constraintTop_toBottomOf="@id/banner_pp" />
|
app:layout_constraintTop_toBottomOf="@id/banner_pp"
|
||||||
|
android:contentDescription="@string/edit_profile" />
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/account_personal_note"
|
android:id="@+id/account_personal_note"
|
||||||
android:layout_width="45dp"
|
android:layout_width="45dp"
|
||||||
|
@ -106,7 +108,8 @@
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintStart_toEndOf="@id/account_follow"
|
app:layout_constraintStart_toEndOf="@id/account_follow"
|
||||||
app:layout_constraintTop_toBottomOf="@id/banner_pp" />
|
app:layout_constraintTop_toBottomOf="@id/banner_pp"
|
||||||
|
android:contentDescription="@string/action_add_notes" />
|
||||||
<View
|
<View
|
||||||
android:id="@+id/fake_actionbar"
|
android:id="@+id/fake_actionbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -115,29 +118,30 @@
|
||||||
android:background="@color/black"
|
android:background="@color/black"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageView
|
||||||
android:id="@+id/action_back"
|
android:id="@+id/action_back"
|
||||||
android:layout_width="40dp"
|
android:layout_width="30dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="30dp"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="10dp"
|
||||||
android:background="?attr/selectableItemBackgroundBorderless"
|
|
||||||
android:contentDescription="@string/go_back"
|
android:contentDescription="@string/go_back"
|
||||||
android:src="@drawable/ic_back"
|
android:src="@drawable/ic_back"
|
||||||
|
android:tint="@color/white"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageView
|
||||||
android:id="@+id/account_menu"
|
android:id="@+id/account_menu"
|
||||||
android:layout_width="40dp"
|
android:layout_width="30dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="30dp"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="10dp"
|
||||||
android:background="?attr/selectableItemBackgroundBorderless"
|
|
||||||
android:contentDescription="@string/open_menu"
|
android:contentDescription="@string/open_menu"
|
||||||
android:src="@drawable/ic_more_vert"
|
android:src="@drawable/ic_more_vert"
|
||||||
|
android:tint="@color/white"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
@ -195,7 +199,8 @@
|
||||||
android:text="Peertube"
|
android:text="Peertube"
|
||||||
android:id="@+id/account_type"
|
android:id="@+id/account_type"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
@ -297,7 +302,8 @@
|
||||||
android:layout_marginEnd="5dp"
|
android:layout_marginEnd="5dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content"
|
||||||
|
tools:ignore="HardcodedText" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
@ -501,11 +507,9 @@
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="10dp"
|
||||||
android:layout_marginRight="10dp"
|
|
||||||
android:contentDescription="@string/profile_picture" />
|
android:contentDescription="@string/profile_picture" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_marginLeft="5dp"
|
|
||||||
android:layout_marginStart="5dp"
|
android:layout_marginStart="5dp"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:id="@+id/show_account_title"
|
android:id="@+id/show_account_title"
|
||||||
|
@ -516,26 +520,25 @@
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ImageButton
|
<ImageView
|
||||||
android:background="?attr/selectableItemBackgroundBorderless"
|
|
||||||
android:id="@+id/reload_tabs"
|
android:id="@+id/reload_tabs"
|
||||||
android:layout_width="30dp"
|
android:layout_width="30dp"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:src="@drawable/ic_refresh"
|
android:src="@drawable/ic_refresh"
|
||||||
|
android:tint="?attr/iconColor"
|
||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="10dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:contentDescription="@string/refresh" />
|
android:contentDescription="@string/refresh" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageView
|
||||||
android:background="?attr/selectableItemBackgroundBorderless"
|
|
||||||
android:id="@+id/action_more"
|
android:id="@+id/action_more"
|
||||||
android:layout_width="30dp"
|
android:layout_width="30dp"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:src="@drawable/ic_more_vert"
|
android:src="@drawable/ic_more_vert"
|
||||||
|
android:tint="?attr/iconColor"
|
||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="10dp"
|
||||||
android:layout_marginRight="10dp"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:contentDescription="@string/display_toot_truncate" />
|
android:contentDescription="@string/display_toot_truncate" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -1263,4 +1263,6 @@
|
||||||
<string name="background_color">Change the background color for timelines</string>
|
<string name="background_color">Change the background color for timelines</string>
|
||||||
<string name="pin_tag">Pin this tag</string>
|
<string name="pin_tag">Pin this tag</string>
|
||||||
<string name="logo_of_the_instance">Logo of the instance</string>
|
<string name="logo_of_the_instance">Logo of the instance</string>
|
||||||
|
<string name="edit_profile">Edite profile</string>
|
||||||
|
<string name="make_an_action">Make an action</string>
|
||||||
</resources>
|
</resources>
|
Loading…
Reference in New Issue