layout fix, string message update, added toStrings to model classes

Signed-off-by: nuclearfog <hatespirit666@gmail.com>
This commit is contained in:
nuclearfog 2021-10-26 10:02:40 +02:00
parent 01f0037229
commit a14b2400ae
No known key found for this signature in database
GPG Key ID: AA0271FBE406DB98
13 changed files with 56 additions and 46 deletions

View File

@ -50,7 +50,8 @@ import org.nuclearfog.twidda.dialog.ConfirmDialog.OnConfirmListener;
import java.util.regex.Pattern;
/**
* Activity to show an user list, members and tweets
* This activity shows content of an user list
* like tweets, list member and follower
*
* @author nuclearfog
*/
@ -309,7 +310,7 @@ public class ListDetail extends AppCompatActivity implements OnTabSelectedListen
public void onSuccess(String[] names) {
String info = names[0];
if (!info.startsWith("@"))
info = '@' + info;
info = '@' + info + ' ';
info += getString(R.string.info_user_added_to_list);
Toast.makeText(this, info, Toast.LENGTH_SHORT).show();
invalidateOptionsMenu();

View File

@ -1,5 +1,6 @@
package org.nuclearfog.twidda.backend.model;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
/**
@ -79,4 +80,13 @@ public class Account {
public String[] getKeys() {
return new String[]{key1, key2};
}
@NonNull
@Override
public String toString() {
if (user != null)
return user + " date:" + loginDate;
return "id:" + userId + " date:" + loginDate;
}
}

View File

@ -116,6 +116,6 @@ public class Message {
@NonNull
@Override
public String toString() {
return sender.getScreenname() + " to " + receiver.getScreenname() + " " + message;
return "from:" + sender.getScreenname() + " to:" + receiver.getScreenname() + " msg:" + message;
}
}

View File

@ -89,6 +89,6 @@ public class Relation {
@NonNull
@Override
public String toString() {
return ", isFriend=" + isFriend + ", isFollower=" + isFollower;
return "isFriend:" + isFriend + " isFollower:" + isFollower;
}
}

View File

@ -91,7 +91,7 @@ public class Trend {
public String getSearchString() {
if (trendName.startsWith("#"))
return trendName;
if (!trendName.contains("\""))
if (!trendName.startsWith("\"") || !trendName.endsWith("\""))
return "\"" + trendName + "\"";
return trendName;
}

View File

@ -128,14 +128,14 @@ public class Tweet implements Serializable {
this.tweet = tweet;
if (source != null)
this.source = source;
if (replyName != null) {
this.replyName = replyName;
this.userMentions = replyName;
}
if (place != null)
this.locationName = place;
if (geo != null)
this.locationCoordinates = geo;
if (replyName != null) {
this.replyName = replyName;
this.userMentions = replyName;
}
this.tweetID = tweetID;
this.user = user;
this.retweetCount = retweetCount;
@ -474,6 +474,6 @@ public class Tweet implements Serializable {
@NonNull
@Override
public String toString() {
return user.getScreenname() + ": " + tweet;
return "from:" + user.getScreenname() + " text:" + tweet;
}
}

View File

@ -140,7 +140,7 @@ public class TwitterList implements Serializable {
@Override
@NonNull
public String toString() {
return title + " " + description;
return "title:" + title + " description:" + description;
}

View File

@ -333,6 +333,6 @@ public class User implements Serializable {
@NonNull
@Override
public String toString() {
return username + " " + screenName;
return "\"" + username + "\" " + screenName;
}
}

View File

@ -55,9 +55,6 @@ public final class ErrorHandler {
case USER_NOT_FOUND:
return context.getString(R.string.error_user_not_found);
case APP_SUSPENDED:
return context.getString(R.string.error_request_token);
case RESOURCE_NOT_FOUND:
return context.getString(R.string.error_not_found);
@ -103,6 +100,7 @@ public final class ErrorHandler {
case ACCOUNT_UPDATE_FAILED:
return context.getString(R.string.error_acc_update);
case APP_SUSPENDED:
case ERROR_API_ACCESS_DENIED:
GlobalSettings settings = GlobalSettings.getInstance(context);
if (settings.isCustomApiSet())

View File

@ -44,7 +44,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="@dimen/settings_color_button_height"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:baselineAligned="false">
@ -71,7 +71,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="@dimen/settings_color_button_height"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:baselineAligned="false">
@ -98,7 +98,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="@dimen/settings_color_button_height"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:baselineAligned="false">
@ -125,7 +125,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="@dimen/settings_color_button_height"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:baselineAligned="false">
@ -152,7 +152,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="@dimen/settings_color_button_height"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:baselineAligned="false">
@ -193,7 +193,7 @@
android:padding="@dimen/settings_layout_padding">
<TextView
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:text="@string/settings_look"

View File

@ -167,7 +167,7 @@
<string name="descr_add_profile_image">Profilbild ändern</string>
<string name="settings_enable_hq_img">Bilder in hoher Auflösung</string>
<string name="menu_app_info">Über</string>
<string name="info_user_added_to_list">Nutzer wurde zur Liste hinzugefügt!</string>
<string name="info_user_added_to_list">wurde zur Liste hinzugefügt!</string>
<string name="error_username_format">Nutzername falsch!</string>
<string name="error_not_defined">Undefinierter Fehler!</string>
<string name="dialog_button_yes">Ja</string>
@ -208,8 +208,8 @@
<string name="settings_enable_toolbar_overlap">Kompakte Profilansicht</string>
<string name="account_user_unnamed">\'unbenannt\'</string>
<string name="menu_excluded_users">Blocklisten</string>
<string name="menu_hint_mute_user">\@Name stummschalten</string>
<string name="menu_hint_block_user">\@Name blockieren</string>
<string name="menu_hint_mute_user">\@name stummschalten</string>
<string name="menu_hint_block_user">\@name blockieren</string>
<string name="menu_exclude_user">Nutzer ausschließen</string>
<string name="menu_search_filter">Ergebnisse filtern</string>
<string name="menu_refresh_exclude">Filterliste aktualisieren</string>

View File

@ -13,6 +13,7 @@
<dimen name="settings_layout_padding">16dp</dimen>
<dimen name="settings_textsize">20sp</dimen>
<dimen name="settings_button_height">30sp</dimen>
<dimen name="settings_color_button_height">42sp</dimen>
<dimen name="settings_color_button_margin">2dp</dimen>
<dimen name="settings_color_button_stroke_width">2dp</dimen>
<dimen name="settings_color_button_corner_radius">4dp</dimen>

View File

@ -6,6 +6,7 @@
<!-- app links and resources-->
<string name="app_info_twitter_link_1" translatable="false">https://support.twitter.com/articles/18311-the-twitter-rules</string>
<string name="app_info_twitter_link_2" translatable="false">https://help.twitter.com/rules-and-policies/twitter-api</string>
<string name="settings_info_link" translatable="false">https://github.com/nuclearfog/Shitter</string>
<string name="profile_image">Profile image</string>
<string name="login_pin">enter PIN</string>
@ -35,20 +36,20 @@
<string name="directmessage">Directmessage</string>
<string name="username">Username</string>
<string name="dm_message">Message</string>
<string name="confirm_cancel_message">cancel message?</string>
<string name="confirm_cancel_message">discard message?</string>
<string name="settings_logout">log out</string>
<string name="dm_answer">answer</string>
<string name="delete_dm">delete</string>
<string name="confirm_unfollow">unfollow user?</string>
<string name="confirm_block">block user?</string>
<string name="confirm_log_lout">log out?</string>
<string name="confirm_cancel_tweet">cancel tweet?</string>
<string name="confirm_cancel_tweet">discard tweet?</string>
<string name="image_preview">Image preview</string>
<string name="tweet_add_image">add new image</string>
<string name="send_tweet">send Tweet</string>
<string name="send_tweet">share Tweet</string>
<string name="tweet_close">close editor</string>
<string name="profile_link">Link</string>
<string name="close_dm">Close direct message</string>
<string name="close_dm">close direct message</string>
<string name="profile_location">Location</string>
<string name="profile_bio">Bio</string>
<string name="confirm_discard">discard changes?</string>
@ -62,7 +63,6 @@
<string name="proxy_password">Password</string>
<string name="settings_key1_hint">Consumer key</string>
<string name="settings_key2_hint">Consumer secret</string>
<string name="settings_info_link" translatable="false">https://github.com/nuclearfog/Shitter</string>
<string name="confirm_mute">mute user?</string>
<string name="item_list_pb_desc">Profile of the list owner</string>
<string name="list_appbar">Lists</string>
@ -71,7 +71,7 @@
<string name="edit_description_hint">enter profile description</string>
<string name="settings_font_style">Font style</string>
<string name="page_profile_editor">edit profile</string>
<string name="delete_list">delete List</string>
<string name="delete_list">delete userlist</string>
<string name="confirm_delete_list">delete userlist?</string>
<string name="confirm_delete_message">delete message?</string>
<string name="confirm_unfollow_list">unfollow list?</string>
@ -91,7 +91,7 @@
<string name="settings_enable_proxy_auth">enable proxy authentication</string>
<string name="settings_setup_custom_keys">setup custom API keys</string>
<string name="confirm_back">back</string>
<string name="tweet_sensitive_media">Potentially sensitive content</string>
<string name="tweet_sensitive_media">sensitive content</string>
<string name="login_info">3 steps to login</string>
<string name="login_first_opt" translatable="false">1.</string>
<string name="login_sec_opt" translatable="false">2.</string>
@ -116,32 +116,32 @@
<string name="button_share">share link</string>
<string name="settings_rt_icon_color">Retweet</string>
<string name="settings_fv_icon_color">Favorite</string>
<string name="settings_follow_req_color">Request icon</string>
<string name="settings_follow_color">Follow icon</string>
<string name="settings_follow_req_color">Follow request</string>
<string name="settings_follow_color">Following icon</string>
<string name="account_page" translatable="false">Accounts</string>
<string name="confirm_remove_account">Remove account from list?</string>
<string name="confirm_remove_account">remove account from list?</string>
<string name="account_user_id_prefix" translatable="false">User ID:</string>
<string name="account_user_unnamed">\'unnamed\'</string>
<!-- toast messages to inform user -->
<string name="info_user_removed">User removed from list</string>
<string name="info_adding_user_to_list">adding user to list</string>
<string name="info_user_added_to_list">" user added to List"</string>
<string name="info_user_added_to_list">"added to List"</string>
<string name="info_list_updated">Userlist updated</string>
<string name="info_list_created">Userlist created</string>
<string name="info_fetching_link">redirecting to Twitter login</string>
<string name="info_login_to_twitter">login to Twitter</string>
<string name="error_wrong_connection_settings">Wrong connection settings!</string>
<string name="error_wrong_connection_settings">wrong connection settings!</string>
<string name="info_cant_add_video">can\'t add video</string>
<string name="info_cant_add_gif">can\'t add GIF</string>
<string name="info_get_link">get Twitter PIN from browser first. Please press the first button!</string>
<string name="info_get_link">please open twitter login page first to get the PIN</string>
<string name="info_gps_attached">GPS position added</string>
<string name="info_tweet_retweeted">retweeted</string>
<string name="info_tweet_unretweeted">Retweet removed</string>
<string name="info_tweet_favored">Tweet added to favorites</string>
<string name="info_tweet_unfavored">Tweet removed from favorites</string>
<string name="info_user_muted">User muted</string>
<string name="info_user_unmuted">user unmuted</string>
<string name="info_user_unmuted">User unmuted</string>
<string name="info_dm_send">Directmessage sent</string>
<string name="info_image_saved">Image saved</string>
<string name="info_clipboard">Link copied to clipboard</string>
@ -153,10 +153,10 @@
<string name="info_user_unblocked">unblocked</string>
<string name="info_tweet_removed">Tweet removed</string>
<string name="info_tweet_sent">Tweet sent</string>
<string name="info_location_pending">Location is pending, please wait.</string>
<string name="info_location_pending">requesting location, please wait</string>
<string name="info_refreshing_exclude_list">refreshing exclude list</string>
<string name="info_exclude_list_updated">exclude list updated!</string>
<string name="info_permission_read">Read permission needed to access images and videos</string>
<string name="info_permission_read">Read permission needed to access images and videos.</string>
<string name="info_permission_location">Location permission only needed to add location information to tweets.</string>
<string name="info_permission_write">Write permission used to store images.</string>
<string name="info_error">Error</string>
@ -164,9 +164,9 @@
<!-- toast messages for error information -->
<string name="error_empty_tweet">Empty tweet!</string>
<string name="error_dm">enter username or message!</string>
<string name="error_not_found">Not found!</string>
<string name="error_not_found">not found!</string>
<string name="error_enter_pin">enter PIN!</string>
<string name="error_limit_exceeded">"Rate limit exceeded! Retry after:"</string>
<string name="error_limit_exceeded">"Rate limit exceeded! Retry after: "</string>
<string name="error_open_link">could not open link!</string>
<string name="error_cant_load_video">could not play video!</string>
<string name="error_image_loading">could not load image!</string>
@ -177,8 +177,8 @@
<string name="error_connection_failed">Connection failed!</string>
<string name="error_invalid_link">Invalid link!</string>
<string name="error_cant_copy_clipboard">can\'t copy link to clipboard!</string>
<string name="error_gps">could not fetch GPS data!</string>
<string name="error_token_not_set">Please get link first!</string>
<string name="error_gps">could not fetch location information!</string>
<string name="error_token_not_set">Please open the twitter login page first to get the PIN!</string>
<string name="error_dm_send">can\'t send direct message to this user!</string>
<string name="error_image_save">could not save Image</string>
<string name="error_not_authorized">Not authorized!</string>
@ -200,7 +200,7 @@
<string name="error_api_key_expired">Error, API Keys expired! Please update app!</string>
<string name="error_mention_exceed">Too much mentions!</string>
<string name="error_twitter_search">Error, search query is too long or contains illegal characters!</string>
<string name="error_not_defined">Not defined Error!</string>
<string name="error_not_defined">Not specified error!</string>
<!-- menu icon strings -->
<string name="menu_tweet">write Tweet</string>
@ -228,7 +228,7 @@
<string name="menu_unfollow_list">unfollow list</string>
<string name="menu_user_unfollow">unfollow</string>
<string name="menu_user_unblock">unblock</string>
<string name="menu_excluded_users">Block lists</string>
<string name="menu_excluded_users">Blocklists</string>
<string name="menu_exclude_user">exclude user</string>
<string name="menu_search_filter">filter results</string>
<string name="menu_hint_mute_user">enter @name to mute</string>