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

View File

@ -95,7 +95,9 @@ public class TweetDetail extends AppCompatActivity implements View.OnClickListen
private void setContent() {
ColorPreferences mColor = ColorPreferences.getInstance(getApplicationContext());
LinearLayout background = (LinearLayout) findViewById(R.id.tweet_detail);
LinearLayout tweetaction = (LinearLayout) findViewById(R.id.tweetbar);
background.setBackgroundColor(mColor.getColor(ColorPreferences.BACKGROUND));
tweetaction.setBackgroundColor(mColor.getColor(ColorPreferences.BACKGROUND));
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"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/barlayout_profile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:fitsSystemWindows="false">
android:background="@android:color/transparent">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
app:toolbarId="@+id/tweet_toolbar">
<LinearLayout
@ -28,7 +26,7 @@
<android.support.v7.widget.Toolbar
android:id="@+id/profile_toolbar"
android:layout_width="match_parent"
android:layout_height="@dimen/bar_wide"/>
android:layout_height="@dimen/bar_wide" />
<ImageView
android:id="@+id/banner"

View File

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