Added Picasso library

Minor Bugfixes
This commit is contained in:
NudeDude 2018-01-19 21:25:46 +01:00
parent 9b0753bea4
commit 4c24bfb463
4 changed files with 15 additions and 12 deletions

View File

@ -119,13 +119,14 @@ public class ShowStatus extends AsyncTask<Long, Void, Boolean> {
ansNo++; ansNo++;
} }
} }
if(toggleImg) if(toggleImg) {
setMedia(currentTweet); setMedia(currentTweet);
}
return true; return true;
} else { } else {
if(id[1]==RETWEET) { if(id[1]==RETWEET) {
if(retweeted) { if(retweeted) {
//TODO //TODO destroy Retweet
} else { } else {
twitter.retweetStatus(tweetID); twitter.retweetStatus(tweetID);
retweeted = true; retweeted = true;
@ -186,10 +187,11 @@ public class ShowStatus extends AsyncTask<Long, Void, Boolean> {
private void setMedia(twitter4j.Status tweet) throws Exception { private void setMedia(twitter4j.Status tweet) throws Exception {
String pbLink = tweet.getUser().getMiniProfileImageURL(); String pbLink = tweet.getUser().getMiniProfileImageURL();
MediaEntity[] media = tweet.getMediaEntities();
InputStream iStream = new URL(pbLink).openStream(); InputStream iStream = new URL(pbLink).openStream();
profile_btm = BitmapFactory.decodeStream(iStream); profile_btm = BitmapFactory.decodeStream(iStream);
MediaEntity[] media = tweet.getMediaEntities();
if( media.length > 0 ) { if( media.length > 0 ) {
InputStream mediaStream = new URL(media[0].getMediaURL()).openStream(); InputStream mediaStream = new URL(media[0].getMediaURL()).openStream();
tweet_btm = BitmapFactory.decodeStream(mediaStream); tweet_btm = BitmapFactory.decodeStream(mediaStream);

View File

@ -95,7 +95,9 @@ public class TweetDetail extends AppCompatActivity implements View.OnClickListen
private void setContent() { private void setContent() {
ColorPreferences mColor = ColorPreferences.getInstance(getApplicationContext()); ColorPreferences mColor = ColorPreferences.getInstance(getApplicationContext());
LinearLayout background = (LinearLayout) findViewById(R.id.tweet_detail); LinearLayout background = (LinearLayout) findViewById(R.id.tweet_detail);
LinearLayout tweetaction = (LinearLayout) findViewById(R.id.tweetbar);
background.setBackgroundColor(mColor.getColor(ColorPreferences.BACKGROUND)); background.setBackgroundColor(mColor.getColor(ColorPreferences.BACKGROUND));
tweetaction.setBackgroundColor(mColor.getColor(ColorPreferences.BACKGROUND));
new ShowStatus(this).execute(tweetID); new ShowStatus(this).execute(tweetID);
} }
} }

View File

@ -2,21 +2,19 @@
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout <android.support.design.widget.AppBarLayout
android:id="@+id/barlayout_profile" android:id="@+id/barlayout_profile"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@android:color/transparent" android:background="@android:color/transparent">
android:fitsSystemWindows="false">
<android.support.design.widget.CollapsingToolbarLayout <android.support.design.widget.CollapsingToolbarLayout
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"
app:layout_scrollFlags="scroll|exitUntilCollapsed" app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
app:toolbarId="@+id/tweet_toolbar"> app:toolbarId="@+id/tweet_toolbar">
<LinearLayout <LinearLayout
@ -28,7 +26,7 @@
<android.support.v7.widget.Toolbar <android.support.v7.widget.Toolbar
android:id="@+id/profile_toolbar" android:id="@+id/profile_toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/bar_wide"/> android:layout_height="@dimen/bar_wide" />
<ImageView <ImageView
android:id="@+id/banner" android:id="@+id/banner"

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -94,6 +95,7 @@
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:contentDescription="@string/tweet_image" android:contentDescription="@string/tweet_image"
app:srcCompat="@android:color/black" /> app:srcCompat="@android:color/black" />
@ -107,7 +109,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fillViewport="true" android:fillViewport="true"
android:fitsSystemWindows="true"
app:layout_behavior="android.support.design.widget.AppBarLayout$ScrollingViewBehavior"> app:layout_behavior="android.support.design.widget.AppBarLayout$ScrollingViewBehavior">
<LinearLayout <LinearLayout
@ -116,10 +117,10 @@
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:id="@+id/tweetbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:addStatesFromChildren="false" android:addStatesFromChildren="false"
android:background="@color/twitterBlau"
android:gravity="center_vertical|center_horizontal" android:gravity="center_vertical|center_horizontal"
android:orientation="horizontal" android:orientation="horizontal"
android:padding="5dp"> android:padding="5dp">