v1.4.1
layout fix
This commit is contained in:
parent
4b4145d056
commit
36586164b3
@ -9,7 +9,7 @@ android {
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 28
|
||||
versionCode 1
|
||||
versionName '1.4'
|
||||
versionName '1.4.1'
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,10 @@ import java.util.List;
|
||||
|
||||
import twitter4j.TwitterException;
|
||||
|
||||
import static android.view.View.VISIBLE;
|
||||
import static android.view.View.GONE;
|
||||
|
||||
|
||||
public class ProfileLoader extends AsyncTask<Long, Void, Void> {
|
||||
|
||||
public enum Mode {
|
||||
@ -238,25 +242,19 @@ public class ProfileLoader extends AsyncTask<Long, Void, Void> {
|
||||
View followback = ui.get().findViewById(R.id.followback);
|
||||
View verified = ui.get().findViewById(R.id.profile_verify);
|
||||
View locked = ui.get().findViewById(R.id.profile_locked);
|
||||
View profile_head = ui.get().findViewById(R.id.profile_header);
|
||||
|
||||
if (mode == Mode.LDR_PROFILE) {
|
||||
View following_ico = ui.get().findViewById(R.id.following_ico);
|
||||
View follower_ico = ui.get().findViewById(R.id.follower_ico);
|
||||
View date_ico = ui.get().findViewById(R.id.date_ico);
|
||||
TextView txtCreated = ui.get().findViewById(R.id.profile_date);
|
||||
|
||||
String date = sdf.format(new Date(user.getCreatedAt()));
|
||||
txtCreated.setText(date);
|
||||
|
||||
follower_ico.setVisibility(View.VISIBLE);
|
||||
following_ico.setVisibility(View.VISIBLE);
|
||||
date_ico.setVisibility(View.VISIBLE);
|
||||
if (user.isVerified())
|
||||
verified.setVisibility(View.VISIBLE);
|
||||
verified.setVisibility(VISIBLE);
|
||||
if (isFollowed)
|
||||
followback.setVisibility(View.VISIBLE);
|
||||
followback.setVisibility(VISIBLE);
|
||||
if (user.isLocked()) {
|
||||
locked.setVisibility(View.VISIBLE);
|
||||
locked.setVisibility(VISIBLE);
|
||||
} else {
|
||||
if(!txtFollowing.isClickable()) {
|
||||
txtFollowing.setOnClickListener(new View.OnClickListener() {
|
||||
@ -300,23 +298,26 @@ public class ProfileLoader extends AsyncTask<Long, Void, Void> {
|
||||
|
||||
if (user.getLocation() != null && !user.getLocation().isEmpty()) {
|
||||
txtLocation.setText(user.getLocation());
|
||||
location_ico.setVisibility(View.VISIBLE);
|
||||
location_ico.setVisibility(VISIBLE);
|
||||
} else {
|
||||
txtLocation.setText("");
|
||||
location_ico.setVisibility(View.GONE);
|
||||
location_ico.setVisibility(GONE);
|
||||
}
|
||||
if (user.getLink() != null && !user.getLink().isEmpty()) {
|
||||
txtLink.setText(user.getLink());
|
||||
link_ico.setVisibility(View.VISIBLE);
|
||||
link_ico.setVisibility(VISIBLE);
|
||||
} else {
|
||||
txtLink.setText("");
|
||||
link_ico.setVisibility(View.GONE);
|
||||
link_ico.setVisibility(GONE);
|
||||
}
|
||||
if (imgEnabled) {
|
||||
String link = user.getImageLink() + "_bigger";
|
||||
Picasso.get().load(link).into(profile);
|
||||
}
|
||||
|
||||
if(profile_head.getVisibility() != VISIBLE)
|
||||
profile_head.setVisibility(VISIBLE);
|
||||
|
||||
ui.get().setTweetCount(user.getTweetCount(), user.getFavorCount());
|
||||
|
||||
if (!tweets.isEmpty()) {
|
||||
|
@ -32,6 +32,7 @@ import java.util.List;
|
||||
|
||||
import twitter4j.TwitterException;
|
||||
|
||||
import static android.view.View.VISIBLE;
|
||||
import static org.nuclearfog.twidda.window.TweetDetail.TWEET_REMOVED;
|
||||
|
||||
public class StatusLoader extends AsyncTask<Long, Void, Void> {
|
||||
@ -177,14 +178,14 @@ public class StatusLoader extends AsyncTask<Long, Void, Void> {
|
||||
tweet_api.setTextColor(font_color);
|
||||
|
||||
if (tweet.getUser().isVerified()) {
|
||||
tweet_verify.setVisibility(View.VISIBLE);
|
||||
tweet_verify.setVisibility(VISIBLE);
|
||||
}
|
||||
if (tweet.getUser().isLocked()) {
|
||||
tweet_locked.setVisibility(View.VISIBLE);
|
||||
tweet_locked.setVisibility(VISIBLE);
|
||||
}
|
||||
if (tweet.getMediaLinks() != null && tweet.getMediaLinks().length > 0) {
|
||||
View mediaButton = ui.get().findViewById(R.id.image_attach);
|
||||
mediaButton.setVisibility(View.VISIBLE);
|
||||
mediaButton.setVisibility(VISIBLE);
|
||||
if(!mediaButton.isClickable()) {
|
||||
mediaButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@ -205,6 +206,8 @@ public class StatusLoader extends AsyncTask<Long, Void, Void> {
|
||||
ImageView profile_img = ui.get().findViewById(R.id.profileimage_detail);
|
||||
ImageView retweetButton = ui.get().findViewById(R.id.rt_button_detail);
|
||||
ImageView favoriteButton = ui.get().findViewById(R.id.fav_button_detail);
|
||||
View tweet_header = ui.get().findViewById(R.id.tweet_head);
|
||||
View tweet_footer = ui.get().findViewById(R.id.tweet_foot);
|
||||
|
||||
username.setText(tweet.getUser().getUsername());
|
||||
username.setTextColor(font_color);
|
||||
@ -219,7 +222,7 @@ public class StatusLoader extends AsyncTask<Long, Void, Void> {
|
||||
String reply = ui.get().getString(R.string.answering);
|
||||
reply += tweet.getReplyName();
|
||||
replyName.setText(reply);
|
||||
replyName.setVisibility(View.VISIBLE);
|
||||
replyName.setVisibility(VISIBLE);
|
||||
if(!replyName.isClickable()) {
|
||||
replyName.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@ -262,6 +265,10 @@ public class StatusLoader extends AsyncTask<Long, Void, Void> {
|
||||
if(tweet.getUser().getId() == homeId) {
|
||||
ui.get().setOptionsmenu();
|
||||
}
|
||||
if(tweet_header.getVisibility() != VISIBLE)
|
||||
tweet_header.setVisibility(VISIBLE);
|
||||
if(tweet_footer.getVisibility() != VISIBLE)
|
||||
tweet_footer.setVisibility(VISIBLE);
|
||||
if(!answers.isEmpty()) {
|
||||
SwipeRefreshLayout ansReload = ui.get().findViewById(R.id.answer_reload);
|
||||
ansReload.setRefreshing(false);
|
||||
|
@ -27,10 +27,14 @@ public class AppDatabase extends SQLiteOpenHelper {
|
||||
"messageID INTEGER PRIMARY KEY,time INTEGER,senderID INTEGER,receiverID INTEGER," +
|
||||
"message TEXT);";
|
||||
|
||||
private static final String INDX_USER_ID = "CREATE UNIQUE INDEX IF NOT EXISTS idx_user ON user(userID);";
|
||||
private static final String INDX_TWEET_ID = "CREATE UNIQUE INDEX IF NOT EXISTS idx_tweet ON tweet(tweetID);";
|
||||
private static final String INDX_TWEET_US = "CREATE INDEX IF NOT EXISTS idx_tweet ON tweet(userID,statusregister);";
|
||||
|
||||
private static AppDatabase mData;
|
||||
|
||||
private AppDatabase(Context context) {
|
||||
super(context, "database.db", null, 2);
|
||||
super(context, "database.db", null, 3);
|
||||
}
|
||||
|
||||
public static synchronized AppDatabase getInstance(Context context) {
|
||||
@ -50,15 +54,24 @@ public class AppDatabase extends SQLiteOpenHelper {
|
||||
db.execSQL(trendTable);
|
||||
|
||||
db.execSQL(messageTable);
|
||||
|
||||
db.execSQL(INDX_USER_ID);
|
||||
db.execSQL(INDX_TWEET_ID);
|
||||
db.execSQL(INDX_TWEET_US);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||
if (oldVersion == 1 && newVersion >= 2) {
|
||||
if (oldVersion < 2 && newVersion >= 2) {
|
||||
final String T_QUERY = "ALTER TABLE user ADD COLUMN tweetCount INTEGER DEFAULT 0;";
|
||||
db.execSQL(T_QUERY);
|
||||
final String F_QUERY = "ALTER TABLE user ADD COLUMN favorCount INTEGER DEFAULT 0;";
|
||||
db.execSQL(F_QUERY);
|
||||
}
|
||||
if(oldVersion < 3 && newVersion >=3) {
|
||||
db.execSQL(INDX_USER_ID);
|
||||
db.execSQL(INDX_TWEET_ID);
|
||||
db.execSQL(INDX_TWEET_US);
|
||||
}
|
||||
}
|
||||
}
|
@ -26,12 +26,14 @@
|
||||
android:layout_height="@dimen/bar_wide" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/profile_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="@dimen/side_padding"
|
||||
android:paddingRight="@dimen/side_padding">
|
||||
android:paddingRight="@dimen/side_padding"
|
||||
android:visibility="invisible">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -26,12 +26,14 @@
|
||||
android:layout_height="@dimen/bar_wide" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/tweet_head"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_horizontal|center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="@dimen/layout_margin"
|
||||
android:paddingRight="@dimen/layout_margin">
|
||||
android:paddingRight="@dimen/layout_margin"
|
||||
android:visibility="invisible">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@ -171,6 +173,7 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/tweet_foot"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:addStatesFromChildren="false"
|
||||
@ -178,7 +181,8 @@
|
||||
android:paddingLeft="@dimen/side_padding"
|
||||
android:paddingTop="@dimen/layout_margin"
|
||||
android:paddingRight="@dimen/side_padding"
|
||||
android:paddingBottom="@dimen/layout_margin">
|
||||
android:paddingBottom="@dimen/layout_margin"
|
||||
android:visibility="invisible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/answer_button"
|
||||
|
Loading…
x
Reference in New Issue
Block a user