mirror of
https://github.com/nuclearfog/Shitter.git
synced 2025-01-16 03:20:37 +01:00
limit tweet/bio height
This commit is contained in:
parent
484d54f341
commit
697fd27d42
@ -221,11 +221,10 @@ public class TwitterUser {
|
||||
private String getBio(User user) {
|
||||
URLEntity entities[] = user.getDescriptionURLEntities();
|
||||
StringBuilder bio = new StringBuilder(user.getDescription());
|
||||
|
||||
for (int i = entities.length - 1; i >= 0; i--) {
|
||||
URLEntity entity = entities[i];
|
||||
bio.replace(entity.getStart(), entity.getEnd(), entity.getExpandedURL());
|
||||
}
|
||||
return bio.toString().replace('\n', ' ');
|
||||
return bio.toString();
|
||||
}
|
||||
}
|
@ -15,10 +15,12 @@ import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.text.method.ScrollingMovementMethod;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.nuclearfog.tag.Tagger.OnTagClickListener;
|
||||
@ -83,9 +85,11 @@ public class TweetDetail extends AppCompatActivity implements OnClickListener,
|
||||
View txtFav = findViewById(R.id.no_fav_detail);
|
||||
View profile_img = findViewById(R.id.profileimage_detail);
|
||||
View answer = findViewById(R.id.answer_button);
|
||||
TextView tweetTxt = findViewById(R.id.tweet_detailed);
|
||||
answerReload = findViewById(R.id.answer_reload);
|
||||
answer_list = findViewById(R.id.answer_list);
|
||||
answer_list.setLayoutManager(new LinearLayoutManager(this));
|
||||
tweetTxt.setMovementMethod(ScrollingMovementMethod.getInstance());
|
||||
|
||||
root.setBackgroundColor(settings.getBackgroundColor());
|
||||
|
||||
|
@ -11,6 +11,7 @@ import android.support.v7.app.AppCompatDelegate;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.text.method.ScrollingMovementMethod;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
@ -70,6 +71,7 @@ public class UserProfile extends AppCompatActivity implements OnRefreshListener,
|
||||
}
|
||||
|
||||
Toolbar tool = findViewById(R.id.profile_toolbar);
|
||||
TextView bioTxt = findViewById(R.id.bio);
|
||||
View root = findViewById(R.id.user_view);
|
||||
homeList = findViewById(R.id.ht_list);
|
||||
homeReload = findViewById(R.id.hometweets);
|
||||
@ -88,6 +90,7 @@ public class UserProfile extends AppCompatActivity implements OnRefreshListener,
|
||||
homeList.setLayoutManager(new LinearLayoutManager(this));
|
||||
favoriteList.setLayoutManager(new LinearLayoutManager(this));
|
||||
root.setBackgroundColor(settings.getBackgroundColor());
|
||||
bioTxt.setMovementMethod(ScrollingMovementMethod.getInstance());
|
||||
|
||||
LayoutInflater inflater = LayoutInflater.from(this);
|
||||
tweetIndicator = inflater.inflate(R.layout.tab_tweets, null);
|
||||
|
@ -170,7 +170,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/layout_margin"
|
||||
android:autoLink="web"
|
||||
android:linksClickable="true" />
|
||||
android:linksClickable="true"
|
||||
android:maxLines="@integer/max_bio_lines"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -113,6 +113,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:autoLink="web"
|
||||
android:linksClickable="true"
|
||||
android:maxLines="@integer/tweet_max_line"
|
||||
android:scrollbars="vertical"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
|
@ -48,4 +48,6 @@
|
||||
<dimen name="bio_height">150dp</dimen>
|
||||
<dimen name="editprofile_padding">20dp</dimen>
|
||||
|
||||
<integer name="tweet_max_line">10</integer>
|
||||
<integer name="max_bio_lines">5</integer>
|
||||
</resources>
|
Loading…
Reference in New Issue
Block a user