Raised SDK to 21

Added Scrollview
This commit is contained in:
NudeDude 2018-01-14 13:08:25 +01:00
parent 88766e7313
commit 23b1cdde0f
9 changed files with 40 additions and 31 deletions

View File

@ -185,9 +185,9 @@ public class MainActivity extends AppCompatActivity implements AdapterView.OnIte
startActivity(intent);
}
break;
case R.id.mention:
case R.id.m_list:
if(!mentionReload.isRefreshing()) {
TimelineAdapter tlAdp = (TimelineAdapter) timelineList.getAdapter();
TimelineAdapter tlAdp = (TimelineAdapter) mentionList.getAdapter();
TweetDatabase twDB = tlAdp.getAdapter();
long tweetID = twDB.getTweetId(position);
long userID = twDB.getUserID(position);

View File

@ -30,7 +30,6 @@ public class MainPage extends AsyncTask<Integer, Void, Boolean>
private SharedPreferences settings;
private int load;
/**
* Main View
* @see MainActivity
@ -40,7 +39,7 @@ public class MainPage extends AsyncTask<Integer, Void, Boolean>
twitterResource = TwitterResource.getInstance(context);
twitterResource.init();// preload
settings = context.getSharedPreferences("settings", 0);
load = settings.getInt("preload", 10);
load = settings.getInt("preload", 10) + 1;
}
@Override

View File

@ -48,12 +48,17 @@ public class ProfileAction extends AsyncTask<Long,Void,Long>
private int load;
private long homeUserID;
/**
* @param context Context to Activity
* @param tool Actionbar
* @see UserProfile
*/
public ProfileAction(Context context, Toolbar tool) {
this.context=context;
this.tool = tool;
SharedPreferences settings = context.getSharedPreferences("settings", 0);
imgEnabled = settings.getBoolean("image_load",false);
load = settings.getInt("preload", 10);
load = settings.getInt("preload", 10) + 1;
homeUserID = settings.getLong("userID", -1);
}
@ -138,10 +143,10 @@ public class ProfileAction extends AsyncTask<Long,Void,Long>
else if(MODE == ACTION_MUTE)
{
if(muted) {
twitter.destroyMute(userId);
twitter.destroyBlock(userId);
muted = false;
} else {
twitter.createMute(userId);
twitter.createBlock(userId);
muted = true;
}
}

View File

@ -33,7 +33,7 @@ public class Search extends AsyncTask<String, Void, String> {
public Search(Context context) {
this.context=context;
SharedPreferences settings = context.getSharedPreferences("settings", 0);
load = settings.getInt("preload", 10);
load = settings.getInt("preload", 10) + 1;
}
@Override

View File

@ -103,10 +103,10 @@ public class ShowStatus extends AsyncTask<Long, Void, Boolean> {
List<twitter4j.Status> stats = result.getTweets();
for(twitter4j.Status reply : stats) {
//if(reply.getInReplyToStatusId() == tweetID) { TODO
if(reply.getInReplyToStatusId() == tweetID) {
answers.add(reply);
ansNo++;
//}
}
}
if(toggleImg)
setMedia(currentTweet);

View File

@ -11,6 +11,7 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TabHost;
import android.widget.TextView;
@ -68,7 +69,6 @@ public class UserProfile extends AppCompatActivity implements View.OnClickListen
tab2.setIndicator("",getResources().getDrawable(R.drawable.favorite_icon));
mTab.addTab(tab2);
mTab.setOnTabChangedListener(this);
txtFollowing.setOnClickListener(this);
txtFollower.setOnClickListener(this);
@ -189,24 +189,17 @@ public class UserProfile extends AppCompatActivity implements View.OnClickListen
}
private void getContent() {
new Thread() {
@Override
public void run() {
TweetDatabase mTweet = new TweetDatabase(UserProfile.this, TweetDatabase.USER_TL, userId);
TweetDatabase fTweet = new TweetDatabase(UserProfile.this, TweetDatabase.FAV_TL, userId);
TweetDatabase mTweet = new TweetDatabase(UserProfile.this, TweetDatabase.USER_TL, userId);
TweetDatabase fTweet = new TweetDatabase(UserProfile.this, TweetDatabase.FAV_TL, userId);
if(mTweet.getSize()>0)
homeTweets.setAdapter(new TimelineAdapter(UserProfile.this,mTweet));
else
new ProfileAction(this, tool).execute(userId, ProfileAction.GET_TWEETS);
if(mTweet.getSize() == 0) {
new ProfileAction(UserProfile.this, tool).execute(userId, ProfileAction.GET_TWEETS);
} else {
homeTweets.setAdapter(new TimelineAdapter(UserProfile.this,mTweet));
}
if(fTweet.getSize() == 0) {
new ProfileAction(UserProfile.this, tool).execute(userId, ProfileAction.GET_FAVS);
} else {
homeFavorits.setAdapter(new TimelineAdapter(UserProfile.this,fTweet));
}
}
}.run();
if(fTweet.getSize()>0)
homeFavorits.setAdapter(new TimelineAdapter(UserProfile.this,fTweet));
else
new ProfileAction(this, tool).execute(userId, ProfileAction.GET_FAVS);
}
private void initElements() {

View File

@ -0,0 +1,4 @@
<vector android:height="24dp" android:viewportHeight="20.0"
android:viewportWidth="20.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFF" android:pathData="M10,17.5L3.5,11H7V3h6v8h3.5L10,17.5z"/>
</vector>

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
@ -85,7 +84,9 @@
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<TextView
@ -127,17 +128,19 @@
android:id="@+id/links"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:fillViewport="true"
android:fitsSystemWindows="false"
app:layout_behavior="android.support.design.widget.AppBarLayout$ScrollingViewBehavior">
<LinearLayout
@ -189,11 +192,15 @@
android:layout_height="match_parent"
android:nestedScrollingEnabled="true" />
</android.support.v4.widget.SwipeRefreshLayout>
</FrameLayout>
</LinearLayout>
</TabHost>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>

View File

@ -80,5 +80,6 @@
trendname TEXT,
trendlink TEXT);
</string>
<string name="refresh_dummy">Aktualisieren</string>
</resources>