Added 280 Char Support

Added Reply Refreshing
Bugfix
This commit is contained in:
NudeDude 2018-02-11 16:16:46 +01:00
parent 5c4862db71
commit 11c0b046e9
7 changed files with 185 additions and 104 deletions

View File

@ -24,7 +24,7 @@
</value> </value>
</option> </option>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">

View File

@ -7,6 +7,7 @@ import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.text.SpannableStringBuilder; import android.text.SpannableStringBuilder;
import android.text.Spanned; import android.text.Spanned;
import android.text.style.ForegroundColorSpan; import android.text.style.ForegroundColorSpan;
@ -15,6 +16,7 @@ import android.widget.Button;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.ListView; import android.widget.ListView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import java.io.InputStream; import java.io.InputStream;
import java.net.URL; import java.net.URL;
@ -37,26 +39,34 @@ public class ShowStatus extends AsyncTask<Long, Void, Long> {
public static final long FAVORITE = 1; public static final long FAVORITE = 1;
public static final long DELETE = 2; public static final long DELETE = 2;
public static final long LOAD_TWEET = 3; public static final long LOAD_TWEET = 3;
public static final long LOAD_REPLY = 4;
private Context c; private Context c;
private TwitterEngine mTwitter;
private ListView replyList; private ListView replyList;
private TextView username,scrName,replyName,tweet; private TextView username,scrName,replyName,tweet;
private TextView used_api,txtAns,txtRet,txtFav,date; private TextView used_api,txtAns,txtRet,txtFav,date;
private Button retweetButton,favoriteButton; private Button retweetButton,favoriteButton;
private ImageView profile_img,tweet_img,tweet_verify; private ImageView profile_img,tweet_verify;
private List<twitter4j.Status> answers; private List<twitter4j.Status> answers;
private SwipeRefreshLayout ansReload;
private TimelineAdapter tlAdp;
private ImageView[] tweetImg;
private Bitmap[] tweet_btm;
private Bitmap profile_btm;
private String errMSG = "";
private String usernameStr, scrNameStr, tweetStr, dateString; private String usernameStr, scrNameStr, tweetStr, dateString;
private String ansStr, rtStr, favStr, repliedUsername, apiName; private String repliedUsername, apiName;
private TwitterEngine mTwitter;
private boolean retweeted, favorited, toggleImg, verified; private boolean retweeted, favorited, toggleImg, verified;
private int rt, fav, ansNo = 0; private int rt, fav, ansNo = 0;
private int highlight; private int highlight;
private long userReply, tweetReplyID; private long userReply, tweetReplyID;
private Bitmap profile_btm, tweet_btm;
public ShowStatus(Context c) { public ShowStatus(Context c) {
mTwitter = TwitterEngine.getInstance(c); mTwitter = TwitterEngine.getInstance(c);
answers = new ArrayList<>(); answers = new ArrayList<>();
tweet_btm = new Bitmap[4];
tweetImg = new ImageView[4];
SharedPreferences settings = c.getSharedPreferences("settings", 0); SharedPreferences settings = c.getSharedPreferences("settings", 0);
toggleImg = settings.getBoolean("image_load", false); toggleImg = settings.getBoolean("image_load", false);
highlight = ColorPreferences.getInstance(c).getColor(ColorPreferences.HIGHLIGHTING); highlight = ColorPreferences.getInstance(c).getColor(ColorPreferences.HIGHLIGHTING);
@ -75,9 +85,13 @@ public class ShowStatus extends AsyncTask<Long, Void, Long> {
txtRet = (TextView) ((TweetDetail)c).findViewById(R.id.no_rt_detail); txtRet = (TextView) ((TweetDetail)c).findViewById(R.id.no_rt_detail);
txtFav = (TextView) ((TweetDetail)c).findViewById(R.id.no_fav_detail); txtFav = (TextView) ((TweetDetail)c).findViewById(R.id.no_fav_detail);
used_api = (TextView) ((TweetDetail)c).findViewById(R.id.used_api); used_api = (TextView) ((TweetDetail)c).findViewById(R.id.used_api);
ansReload = (SwipeRefreshLayout) ((TweetDetail)c).findViewById(R.id.answer_reload);
profile_img = (ImageView) ((TweetDetail)c).findViewById(R.id.profileimage_detail); profile_img = (ImageView) ((TweetDetail)c).findViewById(R.id.profileimage_detail);
tweet_img = (ImageView) ((TweetDetail)c).findViewById(R.id.tweet_image); tweetImg[0] = (ImageView) ((TweetDetail)c).findViewById(R.id.tweet_image);
tweetImg[1] = (ImageView) ((TweetDetail)c).findViewById(R.id.tweet_image2);
tweetImg[2] = (ImageView) ((TweetDetail)c).findViewById(R.id.tweet_image3);
tweetImg[3] = (ImageView) ((TweetDetail)c).findViewById(R.id.tweet_image4);
tweet_verify =(ImageView)((TweetDetail)c).findViewById(R.id.tweet_verify); tweet_verify =(ImageView)((TweetDetail)c).findViewById(R.id.tweet_verify);
retweetButton = (Button) ((TweetDetail)c).findViewById(R.id.rt_button_detail); retweetButton = (Button) ((TweetDetail)c).findViewById(R.id.rt_button_detail);
@ -94,32 +108,28 @@ public class ShowStatus extends AsyncTask<Long, Void, Long> {
long mode = data[1]; long mode = data[1];
try { try {
twitter4j.Status currentTweet = mTwitter.getStatus(tweetID); twitter4j.Status currentTweet = mTwitter.getStatus(tweetID);
scrNameStr = '@'+currentTweet.getUser().getScreenName();
rt = currentTweet.getRetweetCount(); rt = currentTweet.getRetweetCount();
fav = currentTweet.getFavoriteCount(); fav = currentTweet.getFavoriteCount();
retweeted = currentTweet.isRetweetedByMe();
favorited = currentTweet.isFavorited();
if(mode == LOAD_TWEET) {
userReply = currentTweet.getInReplyToUserId(); userReply = currentTweet.getInReplyToUserId();
tweetReplyID = currentTweet.getInReplyToStatusId(); tweetReplyID = currentTweet.getInReplyToStatusId();
verified = currentTweet.getUser().isVerified(); verified = currentTweet.getUser().isVerified();
retweeted = currentTweet.isRetweetedByMe();
favorited = currentTweet.isFavorited();
if(mode == LOAD_TWEET) {
tweetStr = currentTweet.getText(); tweetStr = currentTweet.getText();
usernameStr = currentTweet.getUser().getName(); usernameStr = currentTweet.getUser().getName();
scrNameStr = '@'+currentTweet.getUser().getScreenName(); scrNameStr = '@'+currentTweet.getUser().getScreenName();
apiName = formatString(currentTweet.getSource()); apiName = formatString(currentTweet.getSource());
if(userReply > 0) {
repliedUsername = "Antwort an @"+currentTweet.getInReplyToScreenName();
}
dateString = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss").format(currentTweet.getCreatedAt()); dateString = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss").format(currentTweet.getCreatedAt());
answers = mTwitter.getAnswers(scrNameStr, tweetID);
ansNo = answers.size();
if(toggleImg) { if(userReply > 0)
repliedUsername = "Antwort an @"+currentTweet.getInReplyToScreenName();
if(toggleImg)
setMedia(currentTweet); setMedia(currentTweet);
} }
else if(mode == RETWEET) {
} else if(mode == RETWEET) {
if(retweeted) { if(retweeted) {
mTwitter.retweet(tweetID, true); mTwitter.retweet(tweetID, true);
retweeted = false; retweeted = false;
@ -129,7 +139,8 @@ public class ShowStatus extends AsyncTask<Long, Void, Long> {
retweeted = true; retweeted = true;
rt++; rt++;
} }
} else if(mode == FAVORITE) { }
else if(mode == FAVORITE) {
if(favorited) { if(favorited) {
mTwitter.favorite(tweetID, true); mTwitter.favorite(tweetID, true);
favorited = false; favorited = false;
@ -139,11 +150,19 @@ public class ShowStatus extends AsyncTask<Long, Void, Long> {
favorited = true; favorited = true;
fav++; fav++;
} }
} else if(mode == DELETE) { }
else if(mode == LOAD_REPLY) {
tlAdp = (TimelineAdapter) replyList.getAdapter();
if(tlAdp != null)
tweetID = tlAdp.getItemId(0);
answers = mTwitter.getAnswers(scrNameStr, tweetID);
ansNo = answers.size();
}
else if(mode == DELETE) {
mTwitter.deleteTweet(tweetID); mTwitter.deleteTweet(tweetID);
} }
} catch(Exception err) { } catch(Exception err) {
err.printStackTrace(); errMSG = err.getMessage();
return ERROR; return ERROR;
} }
return mode; return mode;
@ -152,15 +171,19 @@ public class ShowStatus extends AsyncTask<Long, Void, Long> {
@Override @Override
protected void onPostExecute(Long mode) { protected void onPostExecute(Long mode) {
if(mode == LOAD_TWEET) { if(mode == LOAD_TWEET) {
ansStr = Integer.toString(ansNo);
rtStr = Integer.toString(rt);
favStr = Integer.toString(fav);
tweet.setText(highlight(tweetStr)); tweet.setText(highlight(tweetStr));
username.setText(usernameStr); username.setText(usernameStr);
scrName.setText(scrNameStr); scrName.setText(scrNameStr);
txtAns.setText(ansStr);
date.setText(dateString); date.setText(dateString);
used_api.setText(apiName); used_api.setText(apiName);
String favStr = Integer.toString(fav);
String rtStr = Integer.toString(rt);
txtFav.setText(favStr);
txtRet.setText(rtStr);
txtAns.setText("0");
setIcons();
if(repliedUsername != null) { if(repliedUsername != null) {
replyName.setText(repliedUsername); replyName.setText(repliedUsername);
replyName.setVisibility(View.VISIBLE); replyName.setVisibility(View.VISIBLE);
@ -168,13 +191,13 @@ public class ShowStatus extends AsyncTask<Long, Void, Long> {
if(verified) { if(verified) {
tweet_verify.setVisibility(View.VISIBLE); tweet_verify.setVisibility(View.VISIBLE);
} }
TweetDatabase tweetDatabase = new TweetDatabase(answers,c);
TimelineAdapter tlAdp = new TimelineAdapter(c, tweetDatabase);
replyList.setAdapter(tlAdp);
if(toggleImg) { if(toggleImg) {
profile_img.setImageBitmap(profile_btm); profile_img.setImageBitmap(profile_btm);
tweet_img.setImageBitmap(tweet_btm); for(int i = 0 ; i < 4 ; i++) {
tweetImg[i].setImageBitmap(tweet_btm[i]);
} }
}
setIcons();
replyName.setOnClickListener(new View.OnClickListener() { replyName.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
@ -187,12 +210,40 @@ public class ShowStatus extends AsyncTask<Long, Void, Long> {
} }
}); });
} }
else if(mode == RETWEET) {
setIcons(); String rtStr = Integer.toString(rt);
txtRet.setText(rtStr); txtRet.setText(rtStr);
setIcons();
}
else if(mode == FAVORITE) {
String favStr = Integer.toString(fav);
txtFav.setText(favStr); txtFav.setText(favStr);
setIcons();
}
else if(mode == LOAD_REPLY) {
if(tlAdp == null || tlAdp.getCount() == 0) {
TweetDatabase tweetDatabase = new TweetDatabase(answers,c);
tlAdp = new TimelineAdapter(c, tweetDatabase);
replyList.setAdapter(tlAdp);
} else {
TweetDatabase twDb = tlAdp.getData();
twDb.addHot(answers);
tlAdp.notifyDataSetChanged();
ansReload.setRefreshing(false);
}
String ansStr = Integer.toString(ansNo);
txtAns.setText(ansStr);
}
else if(mode == DELETE) {
Toast.makeText(c, "Tweet gelöscht", Toast.LENGTH_LONG).show();
((TweetDetail)c).finish();
}
else {
Toast.makeText(c, "Fehler beim Laden: "+errMSG, Toast.LENGTH_LONG).show();
if(ansReload.isRefreshing()) {
ansReload.setRefreshing(false);
}
}
} }
private void setMedia(twitter4j.Status tweet) throws Exception { private void setMedia(twitter4j.Status tweet) throws Exception {
@ -201,10 +252,10 @@ public class ShowStatus extends AsyncTask<Long, Void, Long> {
InputStream iStream = new URL(pbLink).openStream(); InputStream iStream = new URL(pbLink).openStream();
profile_btm = BitmapFactory.decodeStream(iStream); profile_btm = BitmapFactory.decodeStream(iStream);
byte i = 0;
if( media.length > 0 ) { for(MediaEntity m : media) {
InputStream mediaStream = new URL(media[0].getMediaURL()).openStream(); InputStream mediaStream = new URL(m.getMediaURL()).openStream();
tweet_btm = BitmapFactory.decodeStream(mediaStream); tweet_btm[i++] = BitmapFactory.decodeStream(mediaStream);
} }
} }

View File

@ -350,6 +350,7 @@ public class TwitterEngine {
Query query = new Query("to:"+name+" since_id:"+id+" -filter:retweets"); Query query = new Query("to:"+name+" since_id:"+id+" -filter:retweets");
query.setCount(load); query.setCount(load);
QueryResult result = twitter.search(query); QueryResult result = twitter.search(query);
List<twitter4j.Status> stats = result.getTweets(); List<twitter4j.Status> stats = result.getTweets();

View File

@ -63,14 +63,12 @@ public class TimelineAdapter extends ArrayAdapter implements View.OnClickListene
v.setBackgroundColor(background); v.setBackgroundColor(background);
v.setOnClickListener(this); v.setOnClickListener(this);
} }
String answerStr = Integer.toString(mTweets.getAnswer(position));
String retweetStr = Integer.toString(mTweets.getRetweet(position)); String retweetStr = Integer.toString(mTweets.getRetweet(position));
String favoriteStr = Integer.toString(mTweets.getFavorite(position)); String favoriteStr = Integer.toString(mTweets.getFavorite(position));
((TextView) v.findViewById(R.id.username)).setText(mTweets.getUsername(position)); ((TextView) v.findViewById(R.id.username)).setText(mTweets.getUsername(position));
((TextView) v.findViewById(R.id.screenname)).setText(mTweets.getScreenname(position)); ((TextView) v.findViewById(R.id.screenname)).setText(mTweets.getScreenname(position));
((TextView) v.findViewById(R.id.tweettext)).setText(highlight(mTweets.getTweet(position))); ((TextView) v.findViewById(R.id.tweettext)).setText(highlight(mTweets.getTweet(position)));
((TextView) v.findViewById(R.id.answer_number)).setText(answerStr);
((TextView) v.findViewById(R.id.retweet_number)).setText(retweetStr); ((TextView) v.findViewById(R.id.retweet_number)).setText(retweetStr);
((TextView) v.findViewById(R.id.favorite_number)).setText(favoriteStr); ((TextView) v.findViewById(R.id.favorite_number)).setText(favoriteStr);
((TextView) v.findViewById(R.id.time)).setText(mTweets.getDate(position)); ((TextView) v.findViewById(R.id.time)).setText(mTweets.getDate(position));

View File

@ -4,6 +4,8 @@ import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.view.View; import android.view.View;
@ -27,7 +29,7 @@ import static android.content.DialogInterface.BUTTON_POSITIVE;
* @see ShowStatus * @see ShowStatus
*/ */
public class TweetDetail extends AppCompatActivity implements View.OnClickListener, public class TweetDetail extends AppCompatActivity implements View.OnClickListener,
AdapterView.OnItemClickListener, DialogInterface.OnClickListener { AdapterView.OnItemClickListener, DialogInterface.OnClickListener, SwipeRefreshLayout.OnRefreshListener {
private ListView answer_list; private ListView answer_list;
private long tweetID; private long tweetID;
@ -48,6 +50,7 @@ public class TweetDetail extends AppCompatActivity implements View.OnClickListen
Button favorite = (Button) findViewById(R.id.fav_button_detail); Button favorite = (Button) findViewById(R.id.fav_button_detail);
Button delete = (Button) findViewById(R.id.delete); Button delete = (Button) findViewById(R.id.delete);
ImageView pb = (ImageView) findViewById(R.id.profileimage_detail); ImageView pb = (ImageView) findViewById(R.id.profileimage_detail);
SwipeRefreshLayout answerReload = (SwipeRefreshLayout) findViewById(R.id.answer_reload);
TextView txtRt = (TextView) findViewById(R.id.no_rt_detail); TextView txtRt = (TextView) findViewById(R.id.no_rt_detail);
TextView txtFav = (TextView) findViewById(R.id.no_fav_detail); TextView txtFav = (TextView) findViewById(R.id.no_fav_detail);
@ -58,6 +61,7 @@ public class TweetDetail extends AppCompatActivity implements View.OnClickListen
answer_list.setOnItemClickListener(this); answer_list.setOnItemClickListener(this);
favorite.setOnClickListener(this); favorite.setOnClickListener(this);
retweet.setOnClickListener(this); retweet.setOnClickListener(this);
answerReload.setOnRefreshListener(this);
answer.setOnClickListener(this); answer.setOnClickListener(this);
txtFav.setOnClickListener(this); txtFav.setOnClickListener(this);
txtRt.setOnClickListener(this); txtRt.setOnClickListener(this);
@ -146,17 +150,23 @@ public class TweetDetail extends AppCompatActivity implements View.OnClickListen
startActivity(intent); startActivity(intent);
} }
@Override
public void onRefresh() {
new ShowStatus(this).execute(tweetID, ShowStatus.LOAD_REPLY);
}
private void setContent() { private void setContent() {
ColorPreferences mColor = ColorPreferences.getInstance(getApplicationContext()); ColorPreferences mColor = ColorPreferences.getInstance(getApplicationContext());
int backgroundColor = mColor.getColor(ColorPreferences.BACKGROUND); int backgroundColor = mColor.getColor(ColorPreferences.BACKGROUND);
int fontColor = mColor.getColor(ColorPreferences.FONT_COLOR); int fontColor = mColor.getColor(ColorPreferences.FONT_COLOR);
LinearLayout background = (LinearLayout) findViewById(R.id.tweet_detail); CollapsingToolbarLayout cLayout = (CollapsingToolbarLayout) findViewById(R.id.tweet_detail);
LinearLayout tweetaction = (LinearLayout) findViewById(R.id.tweetbar); LinearLayout tweetaction = (LinearLayout) findViewById(R.id.tweetbar);
TextView txtTw = (TextView) findViewById(R.id.tweet_detailed); TextView txtTw = (TextView) findViewById(R.id.tweet_detailed);
background.setBackgroundColor(backgroundColor); cLayout.setBackgroundColor(backgroundColor);
tweetaction.setBackgroundColor(backgroundColor); tweetaction.setBackgroundColor(backgroundColor);
answer_list.setBackgroundColor(backgroundColor); answer_list.setBackgroundColor(backgroundColor);
txtTw.setTextColor(fontColor); txtTw.setTextColor(fontColor);
new ShowStatus(this).execute(tweetID, ShowStatus.LOAD_TWEET); new ShowStatus(this).execute(tweetID, ShowStatus.LOAD_TWEET);
new ShowStatus(this).execute(tweetID, ShowStatus.LOAD_REPLY);
} }
} }

View File

@ -10,23 +10,22 @@
android:id="@+id/user" android:id="@+id/user"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="5dp" android:layout_marginLeft="10dp"
android:layout_marginRight="5dp" android:layout_marginRight="10dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
android:id="@+id/tweetPb" android:id="@+id/tweetPb"
android:layout_width="40dp" android:layout_width="38dp"
android:layout_height="40dp" android:layout_height="match_parent"
android:layout_margin="5dp"
android:contentDescription="@string/profile_image" /> android:contentDescription="@string/profile_image" />
<ImageView <ImageView
android:id="@+id/list_verify" android:id="@+id/list_verify"
android:layout_width="12dp" android:layout_width="12dp"
android:layout_height="12dp" android:layout_height="12dp"
android:layout_marginTop="8dp" android:layout_margin="5dp"
android:contentDescription="@string/verify" android:contentDescription="@string/verify"
android:visibility="invisible" android:visibility="invisible"
app:srcCompat="@drawable/verify" /> app:srcCompat="@drawable/verify" />
@ -34,7 +33,6 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
@ -81,25 +79,10 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="16dp" android:layout_height="16dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:layout_marginEnd="5dp"
android:layout_marginStart="5dp"
android:addStatesFromChildren="false"
android:gravity="end"
android:orientation="horizontal">
<Button
android:id="@+id/answer"
android:layout_width="16dp"
android:layout_height="16dp"
android:background="@drawable/chat" />
<TextView
android:id="@+id/answer_number"
android:layout_width="64dp"
android:layout_height="match_parent"
android:layout_marginEnd="10dp" android:layout_marginEnd="10dp"
android:layout_marginStart="5dp" android:layout_marginStart="10dp"
android:ems="10" /> android:addStatesFromChildren="false"
android:orientation="horizontal">
<Button <Button
android:id="@+id/retweet" android:id="@+id/retweet"
@ -111,7 +94,6 @@
android:id="@+id/retweet_number" android:id="@+id/retweet_number"
android:layout_width="64dp" android:layout_width="64dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginEnd="10dp"
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:ems="10" /> android:ems="10" />
@ -119,13 +101,13 @@
android:id="@+id/favorite" android:id="@+id/favorite"
android:layout_width="16dp" android:layout_width="16dp"
android:layout_height="16dp" android:layout_height="16dp"
android:layout_marginStart="10dp"
android:background="@drawable/favorite" /> android:background="@drawable/favorite" />
<TextView <TextView
android:id="@+id/favorite_number" android:id="@+id/favorite_number"
android:layout_width="64dp" android:layout_width="64dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginEnd="10dp"
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:ems="10" /> android:ems="10" />

View File

@ -14,6 +14,7 @@
android:fitsSystemWindows="false"> android:fitsSystemWindows="false">
<android.support.design.widget.CollapsingToolbarLayout <android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/tweet_detail"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:contentScrim="?attr/colorPrimary" app:contentScrim="?attr/colorPrimary"
@ -21,33 +22,28 @@
app:toolbarId="@+id/tweet_toolbar"> app:toolbarId="@+id/tweet_toolbar">
<LinearLayout <LinearLayout
android:id="@+id/tweet_detail"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="10dp"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
android:id="@+id/profileimage_detail" android:id="@+id/profileimage_detail"
android:layout_width="64dp" android:layout_width="56dp"
android:layout_height="64dp" android:layout_height="56dp"
android:layout_margin="5dp"
android:contentDescription="@string/profile_image" /> android:contentDescription="@string/profile_image" />
<ImageView <ImageView
android:id="@+id/tweet_verify" android:id="@+id/tweet_verify"
android:layout_width="16dp" android:layout_width="16dp"
android:layout_height="16dp" android:layout_height="16dp"
android:layout_marginEnd="5dp" android:layout_margin="4dp"
android:layout_marginTop="8dp"
android:contentDescription="@string/verify" android:contentDescription="@string/verify"
android:visibility="invisible" android:visibility="invisible"
app:srcCompat="@drawable/verify" /> app:srcCompat="@drawable/verify" />
@ -55,8 +51,6 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="5dp"
android:layout_marginTop="5dp"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
@ -68,9 +62,7 @@
<TextView <TextView
android:id="@+id/scrnamedetail" android:id="@+id/scrnamedetail"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
android:layout_marginBottom="2dp"
android:layout_marginTop="2dp" />
<TextView <TextView
android:id="@+id/timedetail" android:id="@+id/timedetail"
@ -85,16 +77,12 @@
android:id="@+id/answer_reference_detail" android:id="@+id/answer_reference_detail"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:visibility="invisible" /> android:visibility="invisible" />
<TextView <TextView
android:id="@+id/tweet_detailed" android:id="@+id/tweet_detailed"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:autoLink="web" android:autoLink="web"
android:linksClickable="true" android:linksClickable="true"
android:textSize="24sp" /> android:textSize="24sp" />
@ -103,20 +91,61 @@
android:id="@+id/used_api" android:id="@+id/used_api"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:linksClickable="false" android:linksClickable="false"
android:textSize="12sp" /> android:textSize="12sp" />
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView <ImageView
android:id="@+id/tweet_image" android:id="@+id/tweet_image"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="5dp" android:layout_margin="5dp"
android:layout_weight="1"
android:contentDescription="@string/tweet_image" android:contentDescription="@string/tweet_image"
app:srcCompat="@android:color/black" /> app:srcCompat="@android:color/black" />
<ImageView
android:id="@+id/tweet_image2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_weight="1"
android:contentDescription="@string/tweet_image"
app:srcCompat="@android:color/black" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/tweet_image3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_weight="1"
android:contentDescription="@string/tweet_image"
app:srcCompat="@android:color/black" />
<ImageView
android:id="@+id/tweet_image4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_weight="1"
android:contentDescription="@string/tweet_image"
app:srcCompat="@android:color/black" />
</TableRow>
</TableLayout>
</LinearLayout> </LinearLayout>
</android.support.design.widget.CollapsingToolbarLayout> </android.support.design.widget.CollapsingToolbarLayout>
@ -194,11 +223,21 @@
</LinearLayout> </LinearLayout>
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/answer_reload"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ListView <ListView
android:id="@+id/answer_list" android:id="@+id/answer_list"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:nestedScrollingEnabled="true" /> android:nestedScrollingEnabled="true">
</ListView>
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout> </LinearLayout>
</android.support.v4.widget.NestedScrollView> </android.support.v4.widget.NestedScrollView>