mirror of
https://github.com/nuclearfog/Shitter.git
synced 2025-02-07 23:58:44 +01:00
removed hardcoded strings
This commit is contained in:
parent
01f9adc466
commit
693b0124dc
@ -225,6 +225,9 @@ public class ProfileLoader extends AsyncTask<Long,Void,Long> {
|
||||
txtFollower.setText(follower);
|
||||
txtFollowing.setText(following);
|
||||
txtCreated.setText(dateString);
|
||||
txtFollower.setVisibility(View.VISIBLE);
|
||||
txtFollowing.setVisibility(View.VISIBLE);
|
||||
txtCreated.setVisibility(View.VISIBLE);
|
||||
if(location!= null && !location.isEmpty()) {
|
||||
txtLocation.setText(location);
|
||||
txtLocation.setVisibility(View.VISIBLE);
|
||||
@ -265,20 +268,20 @@ public class ProfileLoader extends AsyncTask<Long,Void,Long> {
|
||||
favoritsReload.setRefreshing(false);
|
||||
}
|
||||
else if(mode == ACTION_FOLLOW) {
|
||||
String text;
|
||||
int textId;
|
||||
if(isFollowing)
|
||||
text = "gefolgt!";
|
||||
textId = R.string.followed;
|
||||
else
|
||||
text = "entfolgt!";
|
||||
Toast.makeText(ui.get(),text,Toast.LENGTH_LONG).show();
|
||||
textId = R.string.unfollowed;
|
||||
Toast.makeText(ui.get(), textId, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
else if(mode == ACTION_MUTE) {
|
||||
String text;
|
||||
int textId;
|
||||
if(blocked)
|
||||
text = "gesperrt!";
|
||||
textId = R.string.blocked;
|
||||
else
|
||||
text = "entsperrt!";
|
||||
Toast.makeText(ui.get(),text,Toast.LENGTH_LONG).show();
|
||||
textId = R.string.unblocked;
|
||||
Toast.makeText(ui.get(), textId, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
else if(mode == FAILURE)
|
||||
{
|
||||
@ -300,18 +303,18 @@ public class ProfileLoader extends AsyncTask<Long,Void,Long> {
|
||||
MenuItem blockIcon = tool.getMenu().getItem(2);
|
||||
if (isFollowing) {
|
||||
followIcon.setIcon(R.drawable.follow_enabled);
|
||||
followIcon.setTitle("entfolgen");
|
||||
followIcon.setTitle(R.string.unfollow);
|
||||
} else {
|
||||
followIcon.setIcon(R.drawable.follow);
|
||||
followIcon.setTitle("folgen");
|
||||
followIcon.setTitle(R.string.follow);
|
||||
}
|
||||
if (blocked) {
|
||||
blockIcon.setIcon(R.drawable.block_enabled);
|
||||
blockIcon.setTitle("entblocken");
|
||||
blockIcon.setTitle(R.string.unblock);
|
||||
followIcon.setVisible(false);
|
||||
} else {
|
||||
blockIcon.setIcon(R.drawable.block);
|
||||
blockIcon.setTitle("block");
|
||||
blockIcon.setTitle(R.string.block);
|
||||
followIcon.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package org.nuclearfog.twidda.backend;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.widget.SwipeRefreshLayout;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.text.Spannable;
|
||||
@ -53,11 +52,11 @@ public class StatusLoader extends AsyncTask<Long, Void, Long> {
|
||||
private String usernameStr, scrNameStr, tweetStr, dateString;
|
||||
private String repliedUsername, apiName, profile_pb;
|
||||
private String medialinks[];
|
||||
private String errorMessage = "Status load: ";
|
||||
private boolean retweeted, favorited, toggleImg, verified;
|
||||
private long tweetReplyID, replyUserId;
|
||||
private int rtCount, favCount;
|
||||
private int highlight, font;
|
||||
private String errorMessage = "Status load: ";
|
||||
private int returnCode = 0;
|
||||
|
||||
private WeakReference<TweetDetail> ui;
|
||||
@ -218,21 +217,18 @@ public class StatusLoader extends AsyncTask<Long, Void, Long> {
|
||||
txtAns.setText(ansStr);
|
||||
|
||||
if(tweetReplyID > 1) {
|
||||
String reply = "antwort @"+repliedUsername;
|
||||
String reply = connect.getString(R.string.answering);
|
||||
reply += repliedUsername;
|
||||
replyName.setText(reply);
|
||||
replyName.setVisibility(View.VISIBLE);
|
||||
replyName.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Intent intent = new Intent(ui.get(),TweetDetail.class);
|
||||
Bundle bundle = new Bundle();
|
||||
|
||||
bundle.putLong("tweetID",tweetReplyID);
|
||||
bundle.putLong("userID",replyUserId);
|
||||
bundle.putString("username",repliedUsername);
|
||||
|
||||
intent.putExtras(bundle);
|
||||
ui.get().startActivity(intent);
|
||||
intent.putExtra("tweetID", tweetReplyID);
|
||||
intent.putExtra("userID", replyUserId);
|
||||
intent.putExtra("username", repliedUsername);
|
||||
connect.startActivity(intent);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -258,33 +254,33 @@ public class StatusLoader extends AsyncTask<Long, Void, Long> {
|
||||
setIcons(favoriteButton, retweetButton);
|
||||
}
|
||||
else if(mode == RETWEET) {
|
||||
String toastMsg;
|
||||
TextView txtRet = connect.findViewById(R.id.no_rt_detail);
|
||||
Button retweetButton = connect.findViewById(R.id.rt_button_detail);
|
||||
Button favoriteButton = connect.findViewById(R.id.fav_button_detail);
|
||||
setIcons(favoriteButton, retweetButton);
|
||||
String rtStr = Integer.toString(rtCount);
|
||||
txtRet.setText(rtStr);
|
||||
int textId;
|
||||
if(retweeted) {
|
||||
toastMsg = "retweeted";
|
||||
textId = R.string.retweeted;
|
||||
} else {
|
||||
toastMsg = "retweet entfernt!";
|
||||
textId = R.string.unretweet;
|
||||
}
|
||||
Toast.makeText(ui.get(), toastMsg, Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(ui.get(), textId, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
else if(mode == FAVORITE) {
|
||||
String toastMsg;
|
||||
Button retweetButton = connect.findViewById(R.id.rt_button_detail);
|
||||
Button favoriteButton = connect.findViewById(R.id.fav_button_detail);
|
||||
TextView txtFav = connect.findViewById(R.id.no_fav_detail);
|
||||
setIcons(favoriteButton, retweetButton);
|
||||
String favStr = Integer.toString(favCount);
|
||||
txtFav.setText(favStr);
|
||||
int textId;
|
||||
if(favorited)
|
||||
toastMsg = "zu favoriten hinzugefügt!";
|
||||
textId = R.string.favorited;
|
||||
else
|
||||
toastMsg = "aus favoriten entfernt!";
|
||||
Toast.makeText(ui.get(), toastMsg, Toast.LENGTH_SHORT).show();
|
||||
textId = R.string.unfavorited;
|
||||
Toast.makeText(ui.get(), textId, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
else if(mode == LOAD_REPLY) {
|
||||
SwipeRefreshLayout ansReload = connect.findViewById(R.id.answer_reload);
|
||||
@ -295,7 +291,7 @@ public class StatusLoader extends AsyncTask<Long, Void, Long> {
|
||||
txtAns.setText(ansStr);
|
||||
}
|
||||
else if(mode == DELETE) {
|
||||
Toast.makeText(ui.get(), "Tweet gelöscht", Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(ui.get(), R.string.tweet_removed, Toast.LENGTH_SHORT).show();
|
||||
ui.get().finish();
|
||||
}
|
||||
else if(mode == ERROR) {
|
||||
@ -314,20 +310,11 @@ public class StatusLoader extends AsyncTask<Long, Void, Long> {
|
||||
}
|
||||
|
||||
|
||||
private String formatString(String input) {
|
||||
StringBuilder output = new StringBuilder("gesendet von: ");
|
||||
boolean openTag = false;
|
||||
for(int i = 0 ; i < input.length() ; i++){
|
||||
char current = input.charAt(i);
|
||||
if(current == '>' && !openTag){
|
||||
openTag = true;
|
||||
} else if(current == '<'){
|
||||
openTag = false;
|
||||
} else if(openTag) {
|
||||
output.append(current);
|
||||
}
|
||||
}
|
||||
return output.toString();
|
||||
private String formatString(String text) {
|
||||
String prefix = ui.get().getString(R.string.sent_from);
|
||||
text = text.substring(text.indexOf('>') + 1);
|
||||
text = text.substring(0, text.indexOf('<'));
|
||||
return prefix + text;
|
||||
}
|
||||
|
||||
|
||||
@ -377,15 +364,13 @@ public class StatusLoader extends AsyncTask<Long, Void, Long> {
|
||||
Spanned s = (Spanned) tv.getText();
|
||||
String search = s.subSequence(start, end).toString();
|
||||
Intent intent = new Intent(ui.get(), SearchPage.class);
|
||||
Bundle bundle = new Bundle();
|
||||
if(search.startsWith("#"))
|
||||
bundle.putString("Addition", search);
|
||||
bundle.putString("search", search);
|
||||
intent.putExtras(bundle);
|
||||
intent.putExtra("Addition", search);
|
||||
intent.putExtra("search", search);
|
||||
ui.get().startActivity(intent);
|
||||
}
|
||||
@Override
|
||||
public void updateDrawState(TextPaint ds){
|
||||
public void updateDrawState(TextPaint ds) {
|
||||
ds.setColor(highlight);
|
||||
ds.setUnderlineText(false);
|
||||
}
|
||||
|
@ -120,7 +120,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:drawablePadding="4dp"
|
||||
android:drawableStart="@drawable/following" />
|
||||
android:drawableStart="@drawable/following"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/follower"
|
||||
@ -128,7 +129,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:drawablePadding="4dp"
|
||||
android:drawableStart="@drawable/follower" />
|
||||
android:drawableStart="@drawable/follower"
|
||||
android:visibility="invisible" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@ -171,7 +173,8 @@
|
||||
android:drawablePadding="4dp"
|
||||
android:drawableStart="@drawable/calendar"
|
||||
android:singleLine="true"
|
||||
android:textSize="12sp" />
|
||||
android:textSize="12sp"
|
||||
android:visibility="invisible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -43,4 +43,18 @@
|
||||
<string name="tweet_delete">Tweet löschen</string>
|
||||
<string name="get_tweetlink">Im Browser öffnen</string>
|
||||
<string name="tweet_not_found">Tweet wurde nicht gefunden</string>
|
||||
<string name="unfollow">entfolgen</string>
|
||||
<string name="block" translatable="false">blocken</string>
|
||||
<string name="unblock">entblocken</string>
|
||||
<string name="followed">gefolgt!</string>
|
||||
<string name="unfollowed">entfolgt!</string>
|
||||
<string name="blocked">geblockt!</string>
|
||||
<string name="unblocked">entblockt!</string>
|
||||
<string name="favorited">favoriziert!</string>
|
||||
<string name="unfavorited">favorit entfernt!</string>
|
||||
<string name="retweeted">retweetet!</string>
|
||||
<string name="unretweet">retweet entfernt!</string>
|
||||
<string name="tweet_removed">Tweet gelöscht!</string>
|
||||
<string name="answering">antwort @</string>
|
||||
<string name="sent_from">"gesendet von: "</string>
|
||||
</resources>
|
@ -21,7 +21,7 @@
|
||||
<string name="fullimg">big image</string>
|
||||
<string name="profile_locked">locked</string>
|
||||
<string name="load_factor">tweet count</string>
|
||||
<string name="block" translatable="false">Block</string>
|
||||
<string name="block">Block</string>
|
||||
<string name="follow">follow</string>
|
||||
<string name="retry">retry</string>
|
||||
<string name="cancel">cancel!</string>
|
||||
@ -51,4 +51,17 @@
|
||||
<string name="tweet_delete">Delete</string>
|
||||
<string name="get_tweetlink">Open in Browser</string>
|
||||
<string name="tweet_not_found">Tweet not found</string>
|
||||
<string name="unfollow">unfollow</string>
|
||||
<string name="unblock">unblock</string>
|
||||
<string name="followed">followed</string>
|
||||
<string name="unfollowed">unfollowed!</string>
|
||||
<string name="blocked">blocked</string>
|
||||
<string name="unblocked">unblocked</string>
|
||||
<string name="favorited">favorited!</string>
|
||||
<string name="unfavorited">favorite removed!</string>
|
||||
<string name="retweeted">retweeted!</string>
|
||||
<string name="unretweet">retweet removed!</string>
|
||||
<string name="tweet_removed">Tweet removed!</string>
|
||||
<string name="answering">answering @</string>
|
||||
<string name="sent_from">sent from:</string>
|
||||
</resources>
|
Loading…
x
Reference in New Issue
Block a user