1
0
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:
Austin Huang 2020-08-04 17:59:36 -04:00
parent 758dfe0084
commit af458ce6c6
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
8 changed files with 18 additions and 18 deletions

View File

@ -218,10 +218,11 @@ public final class MainHelper implements SwipeRefreshLayout.OnRefreshListener {
@Override @Override
public void onResult(final FeedStoryModel[] result) { public void onResult(final FeedStoryModel[] result) {
feedStoriesAdapter.setData(result); feedStoriesAdapter.setData(result);
if (result != null && result.length > 0) if (result != null && result.length > 0) {
main.mainBinding.feedStories.setVisibility(View.VISIBLE); main.mainBinding.feedStories.setVisibility(View.VISIBLE);
stories = result; stories = result;
} }
}
}; };
private final MentionClickListener mentionClickListener = new MentionClickListener() { private final MentionClickListener mentionClickListener = new MentionClickListener() {
@Override @Override
@ -976,14 +977,13 @@ public final class MainHelper implements SwipeRefreshLayout.OnRefreshListener {
currentlyExecuting = new LocationFetcher(main.userQuery.split("/")[0], locationModel -> { currentlyExecuting = new LocationFetcher(main.userQuery.split("/")[0], locationModel -> {
main.locationModel = locationModel; main.locationModel = locationModel;
main.mainBinding.toolbar.toolbar.setTitle(locationModel.getName());
if (locationModel == null) { if (locationModel == null) {
main.mainBinding.swipeRefreshLayout.setRefreshing(false); main.mainBinding.swipeRefreshLayout.setRefreshing(false);
Toast.makeText(main, R.string.error_loading_profile, Toast.LENGTH_SHORT).show(); Toast.makeText(main, R.string.error_loading_profile, Toast.LENGTH_SHORT).show();
main.mainBinding.toolbar.toolbar.setTitle(R.string.app_name); main.mainBinding.toolbar.toolbar.setTitle(R.string.app_name);
return; return;
} }
main.mainBinding.toolbar.toolbar.setTitle(locationModel.getName());
final String profileId = locationModel.getId(); final String profileId = locationModel.getId();

View File

@ -632,23 +632,23 @@ public final class PostViewer extends BaseLanguageActivity {
postModel.setBookmark(viewerPostModel.getBookmark()); postModel.setBookmark(viewerPostModel.getBookmark());
if (viewerPostModel.getLike() == true) { if (viewerPostModel.getLike() == true) {
viewerBinding.btnLike.setText(resources.getString(R.string.unlike, viewerPostModel.getLikes())); viewerBinding.btnLike.setText(resources.getString(R.string.unlike, viewerPostModel.getLikes()));
viewerBinding.btnLike.setBackgroundTintList(ColorStateList.valueOf(resources.getColor( viewerBinding.btnLike.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(
R.color.btn_pink_background, null))); getApplicationContext(), R.color.btn_pink_background)));
} }
else { else {
viewerBinding.btnLike.setText(resources.getString(R.string.like, viewerPostModel.getLikes())); viewerBinding.btnLike.setText(resources.getString(R.string.like, viewerPostModel.getLikes()));
viewerBinding.btnLike.setBackgroundTintList(ColorStateList.valueOf(resources.getColor( viewerBinding.btnLike.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(
R.color.btn_lightpink_background, null))); getApplicationContext(), R.color.btn_lightpink_background)));
} }
if (viewerPostModel.getBookmark() == true) { if (viewerPostModel.getBookmark() == true) {
viewerBinding.btnBookmark.setText(R.string.unbookmark); viewerBinding.btnBookmark.setText(R.string.unbookmark);
viewerBinding.btnBookmark.setBackgroundTintList(ColorStateList.valueOf(resources.getColor( viewerBinding.btnBookmark.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(
R.color.btn_orange_background, null))); getApplicationContext(), R.color.btn_orange_background)));
} }
else { else {
viewerBinding.btnBookmark.setText(R.string.bookmark); viewerBinding.btnBookmark.setText(R.string.bookmark);
viewerBinding.btnBookmark.setBackgroundTintList(ColorStateList.valueOf(resources.getColor( viewerBinding.btnBookmark.setBackgroundTintList(ColorStateList.valueOf(ContextCompat.getColor(
R.color.btn_lightorange_background, null))); getApplicationContext(), R.color.btn_lightorange_background)));
} }
} }

View File

@ -479,7 +479,7 @@ public final class StoryViewer extends BaseLanguageActivity {
storyViewerBinding.mention.setTag(mentions); storyViewerBinding.mention.setTag(mentions);
quiz = currentStory.getQuiz(); 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); storyViewerBinding.quiz.setTag(quiz);
releasePlayer(); releasePlayer();

View File

@ -389,10 +389,11 @@ public final class MessageItemsAdapter extends RecyclerView.Adapter<TextMessageV
@Nullable @Nullable
private ProfileModel getUser(final long userId) { private ProfileModel getUser(final long userId) {
if (users != null) { if (users != null) {
for (final ProfileModel user : users) for (final ProfileModel user : users) {
if (Long.toString(userId).equals(user.getId())) return user; if (Long.toString(userId).equals(user.getId())) return user;
return myProfileHolder; return myProfileHolder;
} }
}
return null; return null;
} }
} }

View File

@ -52,7 +52,6 @@ public final class PostsFetcher extends AsyncTask<Void, Void, PostModel[]> {
final boolean isHashTag = id.charAt(0) == '#'; final boolean isHashTag = id.charAt(0) == '#';
final boolean isSaved = id.charAt(0) == '$'; final boolean isSaved = id.charAt(0) == '$';
final boolean isTagged = id.charAt(0) == '%'; final boolean isTagged = id.charAt(0) == '%';
//final boolean isLiked = id.charAt(0) == '^';
final boolean isLocation = id.contains("/"); final boolean isLocation = id.contains("/");
final String url; final String url;

View File

@ -86,12 +86,10 @@ public final class DataBox extends SQLiteOpenHelper {
try (final SQLiteDatabase db = getWritableDatabase()) { try (final SQLiteDatabase db = getWritableDatabase()) {
db.beginTransaction(); db.beginTransaction();
try { try {
final int rowsDeleted = db.delete(TABLE_FAVORITES, KEY_QUERY_TEXT + "=? AND " final int rowsDeleted = db.delete(TABLE_FAVORITES, "query_text=? AND date_added=?",
+ KEY_DATE_ADDED + "=?",
new String[]{query, Long.toString(favoriteModel.getDate())}); new String[]{query, Long.toString(favoriteModel.getDate())});
final int rowsDeletedTwo = db.delete(TABLE_FAVORITES, KEY_QUERY_TEXT + "=? AND " final int rowsDeletedTwo = db.delete(TABLE_FAVORITES, "query_text=? AND date_added=?",
+ KEY_DATE_ADDED + "=?",
new String[]{query.replaceAll("@", ""), Long.toString(favoriteModel.getDate())}); new String[]{query.replaceAll("@", ""), Long.toString(favoriteModel.getDate())});
if (rowsDeleted > 0 || rowsDeletedTwo > 0) db.setTransactionSuccessful(); if (rowsDeleted > 0 || rowsDeletedTwo > 0) db.setTransactionSuccessful();

View File

@ -65,6 +65,7 @@ public final class LocaleUtils {
if (appLanguageIndex == 6) return "it"; if (appLanguageIndex == 6) return "it";
if (appLanguageIndex == 7) return "de"; if (appLanguageIndex == 7) return "de";
if (appLanguageIndex == 8) return "pl"; if (appLanguageIndex == 8) return "pl";
if (appLanguageIndex == 9) return "tr";
return null; return null;
} }

View File

@ -10,6 +10,7 @@
<item>Italian [Thanks to @RAR_Ramar (Telegram)]</item> <item>Italian [Thanks to @RAR_Ramar (Telegram)]</item>
<item>German [Thanks to @peterge1998 (GitHub)]</item> <item>German [Thanks to @peterge1998 (GitHub)]</item>
<item>Polish [Thanks to @Lego8486 (GitHub)]</item> <item>Polish [Thanks to @Lego8486 (GitHub)]</item>
<item>Turkish [Thanks to @faydin90 (Telegram)]</item>
</string-array> </string-array>
<string-array name="theme_presets"> <string-array name="theme_presets">
<item>Auto / Follow System</item> <item>Auto / Follow System</item>