mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-22 14:47:29 +00:00
turkish, plus lgtm & compability fixes
This commit is contained in:
parent
758dfe0084
commit
af458ce6c6
@ -218,10 +218,11 @@ public final class MainHelper implements SwipeRefreshLayout.OnRefreshListener {
|
||||
@Override
|
||||
public void onResult(final FeedStoryModel[] result) {
|
||||
feedStoriesAdapter.setData(result);
|
||||
if (result != null && result.length > 0)
|
||||
if (result != null && result.length > 0) {
|
||||
main.mainBinding.feedStories.setVisibility(View.VISIBLE);
|
||||
stories = result;
|
||||
}
|
||||
}
|
||||
};
|
||||
private final MentionClickListener mentionClickListener = new MentionClickListener() {
|
||||
@Override
|
||||
@ -976,14 +977,13 @@ public final class MainHelper implements SwipeRefreshLayout.OnRefreshListener {
|
||||
currentlyExecuting = new LocationFetcher(main.userQuery.split("/")[0], locationModel -> {
|
||||
main.locationModel = locationModel;
|
||||
|
||||
main.mainBinding.toolbar.toolbar.setTitle(locationModel.getName());
|
||||
|
||||
if (locationModel == null) {
|
||||
main.mainBinding.swipeRefreshLayout.setRefreshing(false);
|
||||
Toast.makeText(main, R.string.error_loading_profile, Toast.LENGTH_SHORT).show();
|
||||
main.mainBinding.toolbar.toolbar.setTitle(R.string.app_name);
|
||||
return;
|
||||
}
|
||||
main.mainBinding.toolbar.toolbar.setTitle(locationModel.getName());
|
||||
|
||||
final String profileId = locationModel.getId();
|
||||
|
||||
|
@ -632,23 +632,23 @@ public final class PostViewer extends BaseLanguageActivity {
|
||||
postModel.setBookmark(viewerPostModel.getBookmark());
|
||||
if (viewerPostModel.getLike() == true) {
|
||||
viewerBinding.btnLike.setText(resources.getString(R.string.unlike, viewerPostModel.getLikes()));
|
||||
viewerBinding.btnLike.setBackgroundTintList(ColorStateList.valueOf(resources.getColor(
|
||||
R.color.btn_pink_background, null)));
|
||||
viewerBinding.btnLike.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(
|
||||
getApplicationContext(), R.color.btn_pink_background)));
|
||||
}
|
||||
else {
|
||||
viewerBinding.btnLike.setText(resources.getString(R.string.like, viewerPostModel.getLikes()));
|
||||
viewerBinding.btnLike.setBackgroundTintList(ColorStateList.valueOf(resources.getColor(
|
||||
R.color.btn_lightpink_background, null)));
|
||||
viewerBinding.btnLike.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(
|
||||
getApplicationContext(), R.color.btn_lightpink_background)));
|
||||
}
|
||||
if (viewerPostModel.getBookmark() == true) {
|
||||
viewerBinding.btnBookmark.setText(R.string.unbookmark);
|
||||
viewerBinding.btnBookmark.setBackgroundTintList(ColorStateList.valueOf(resources.getColor(
|
||||
R.color.btn_orange_background, null)));
|
||||
viewerBinding.btnBookmark.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(
|
||||
getApplicationContext(), R.color.btn_orange_background)));
|
||||
}
|
||||
else {
|
||||
viewerBinding.btnBookmark.setText(R.string.bookmark);
|
||||
viewerBinding.btnBookmark.setBackgroundTintList(ColorStateList.valueOf(resources.getColor(
|
||||
R.color.btn_lightorange_background, null)));
|
||||
viewerBinding.btnBookmark.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(
|
||||
getApplicationContext(), R.color.btn_lightorange_background)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -479,7 +479,7 @@ public final class StoryViewer extends BaseLanguageActivity {
|
||||
storyViewerBinding.mention.setTag(mentions);
|
||||
|
||||
quiz = currentStory.getQuiz();
|
||||
storyViewerBinding.quiz.setVisibility((quiz != null && mentions.length > 0) ? View.VISIBLE : View.GONE);
|
||||
storyViewerBinding.quiz.setVisibility(quiz != null ? View.VISIBLE : View.GONE);
|
||||
storyViewerBinding.quiz.setTag(quiz);
|
||||
|
||||
releasePlayer();
|
||||
|
@ -389,10 +389,11 @@ public final class MessageItemsAdapter extends RecyclerView.Adapter<TextMessageV
|
||||
@Nullable
|
||||
private ProfileModel getUser(final long userId) {
|
||||
if (users != null) {
|
||||
for (final ProfileModel user : users)
|
||||
for (final ProfileModel user : users) {
|
||||
if (Long.toString(userId).equals(user.getId())) return user;
|
||||
return myProfileHolder;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -52,7 +52,6 @@ public final class PostsFetcher extends AsyncTask<Void, Void, PostModel[]> {
|
||||
final boolean isHashTag = id.charAt(0) == '#';
|
||||
final boolean isSaved = id.charAt(0) == '$';
|
||||
final boolean isTagged = id.charAt(0) == '%';
|
||||
//final boolean isLiked = id.charAt(0) == '^';
|
||||
final boolean isLocation = id.contains("/");
|
||||
|
||||
final String url;
|
||||
|
@ -86,12 +86,10 @@ public final class DataBox extends SQLiteOpenHelper {
|
||||
try (final SQLiteDatabase db = getWritableDatabase()) {
|
||||
db.beginTransaction();
|
||||
try {
|
||||
final int rowsDeleted = db.delete(TABLE_FAVORITES, KEY_QUERY_TEXT + "=? AND "
|
||||
+ KEY_DATE_ADDED + "=?",
|
||||
final int rowsDeleted = db.delete(TABLE_FAVORITES, "query_text=? AND date_added=?",
|
||||
new String[]{query, Long.toString(favoriteModel.getDate())});
|
||||
|
||||
final int rowsDeletedTwo = db.delete(TABLE_FAVORITES, KEY_QUERY_TEXT + "=? AND "
|
||||
+ KEY_DATE_ADDED + "=?",
|
||||
final int rowsDeletedTwo = db.delete(TABLE_FAVORITES, "query_text=? AND date_added=?",
|
||||
new String[]{query.replaceAll("@", ""), Long.toString(favoriteModel.getDate())});
|
||||
|
||||
if (rowsDeleted > 0 || rowsDeletedTwo > 0) db.setTransactionSuccessful();
|
||||
|
@ -65,6 +65,7 @@ public final class LocaleUtils {
|
||||
if (appLanguageIndex == 6) return "it";
|
||||
if (appLanguageIndex == 7) return "de";
|
||||
if (appLanguageIndex == 8) return "pl";
|
||||
if (appLanguageIndex == 9) return "tr";
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -10,6 +10,7 @@
|
||||
<item>Italian [Thanks to @RAR_Ramar (Telegram)]</item>
|
||||
<item>German [Thanks to @peterge1998 (GitHub)]</item>
|
||||
<item>Polish [Thanks to @Lego8486 (GitHub)]</item>
|
||||
<item>Turkish [Thanks to @faydin90 (Telegram)]</item>
|
||||
</string-array>
|
||||
<string-array name="theme_presets">
|
||||
<item>Auto / Follow System</item>
|
||||
|
Loading…
Reference in New Issue
Block a user