This commit is contained in:
NudeDude 2018-08-16 22:06:36 +02:00
parent 277f3214f3
commit dbc0b5d007
15 changed files with 29 additions and 44 deletions

View File

@ -111,10 +111,5 @@ public class TwitterSearch extends AsyncTask<String, Void, Boolean> {
searchAdapter.notifyDataSetChanged();
userAdapter.notifyDataSetChanged();
tweetReload.setRefreshing(false);
connect.dismiss();
}
public interface OnDismiss {
void dismiss();
}
}

View File

@ -1,7 +1,6 @@
package org.nuclearfog.twidda.window;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
@ -15,7 +14,6 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;
import android.widget.TabHost;
@ -24,7 +22,6 @@ import android.widget.TabHost.OnTabChangeListener;
import org.nuclearfog.twidda.R;
import org.nuclearfog.twidda.backend.GlobalSettings;
import org.nuclearfog.twidda.backend.TwitterSearch;
import org.nuclearfog.twidda.backend.TwitterSearch.OnDismiss;
import org.nuclearfog.twidda.backend.listitems.Tweet;
import org.nuclearfog.twidda.backend.listitems.TwitterUser;
import org.nuclearfog.twidda.viewadapter.TimelineRecycler;
@ -32,13 +29,12 @@ import org.nuclearfog.twidda.viewadapter.TimelineRecycler.OnItemClicked;
import org.nuclearfog.twidda.viewadapter.UserRecycler;
public class SearchPage extends AppCompatActivity implements UserRecycler.OnItemClicked,
OnRefreshListener, OnTabChangeListener, OnItemClicked, OnDismiss {
OnRefreshListener, OnTabChangeListener, OnItemClicked {
private RecyclerView tweetSearch,userSearch;
private SwipeRefreshLayout tweetReload;
private TwitterSearch mSearch;
private TabHost tabhost;
private Dialog popup;
private View lastView;
private String search = "";
private int tabIndex = 0;
@ -60,7 +56,6 @@ public class SearchPage extends AppCompatActivity implements UserRecycler.OnItem
if(getSupportActionBar() != null)
getSupportActionBar().setDisplayShowTitleEnabled(false);
popup = new Dialog(this);
tweetSearch = findViewById(R.id.tweet_result);
tweetSearch.setLayoutManager(new LinearLayoutManager(this));
tweetSearch.setBackgroundColor(background);
@ -85,8 +80,6 @@ public class SearchPage extends AppCompatActivity implements UserRecycler.OnItem
mSearch.cancel(true);
tweetReload.setRefreshing(false);
}
if (popup.isShowing())
popup.dismiss();
super.onPause();
}
@ -223,29 +216,7 @@ public class SearchPage extends AppCompatActivity implements UserRecycler.OnItem
@SuppressLint("InflateParams")
private void getContent() {
mSearch = new TwitterSearch(this);
tweetReload.setRefreshing(true);
mSearch.execute(search);
popup.requestWindowFeature(Window.FEATURE_NO_TITLE);
popup.setCanceledOnTouchOutside(false);
if (popup.getWindow() != null)
popup.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
View load = getLayoutInflater().inflate(R.layout.item_load, null, false);
View cancelButton = load.findViewById(R.id.kill_button);
popup.setContentView(load);
cancelButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mSearch != null && !mSearch.isCancelled())
mSearch.cancel(true);
popup.dismiss();
}
});
popup.show();
}
@Override
public void dismiss() {
if (popup != null)
popup.dismiss();
}
}

View File

@ -220,6 +220,8 @@ public class TweetDetail extends AppCompatActivity implements OnClickListener,
txtTw.setTextColor(fontColor);
new StatusLoader(this).execute(tweetID, StatusLoader.LOAD_DB);
mStat = new StatusLoader(this);
answerReload.setRefreshing(true);
mReply = new StatusLoader(this);
mStat.execute(tweetID, StatusLoader.LOAD_TWEET);
mReply.execute(tweetID, StatusLoader.LOAD_REPLY);

View File

@ -261,6 +261,8 @@ public class UserProfile extends AppCompatActivity implements OnClickListener,
mProfile = new ProfileLoader(this);
mTweets = new ProfileLoader(this);
mFavorites = new ProfileLoader(this);
homeReload.setRefreshing(true);
favoriteReload.setRefreshing(true);
mProfile.execute(userId, ProfileLoader.GET_INF);
mTweets.execute(userId, ProfileLoader.GET_TWEETS,1L);
mFavorites.execute(userId, ProfileLoader.GET_FAVORS, 1L);

View File

@ -23,4 +23,5 @@
android:layout_height="32dp"
android:background="@drawable/right"
android:visibility="invisible" />
</LinearLayout>

View File

@ -18,4 +18,5 @@
android:layout_gravity="center"
android:contentDescription="@string/progress_kill"
android:src="@drawable/cross" />
</FrameLayout>

View File

@ -27,7 +27,7 @@
android:layout_weight="1"
android:singleLine="true"
android:textSize="20sp" />
</LinearLayout>
</android.support.v7.widget.CardView>

View File

@ -26,6 +26,7 @@
android:layout_height="@dimen/profile_small"
android:layout_gravity="center_vertical"
android:contentDescription="@string/profile_image" />
</android.support.v7.widget.CardView>
<LinearLayout
@ -66,6 +67,7 @@
android:gravity="end"
android:textAlignment="gravity"
android:textSize="12sp" />
</LinearLayout>
<TextView

View File

@ -22,6 +22,7 @@
android:layout_width="48dp"
android:layout_height="48dp"
android:contentDescription="@string/profile_image" />
</android.support.v7.widget.CardView>
<LinearLayout
@ -71,6 +72,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:singleLine="true" />
</LinearLayout>
</LinearLayout>

View File

@ -38,6 +38,7 @@
android:id="@+id/tl_list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
<android.support.v4.widget.SwipeRefreshLayout
@ -49,6 +50,7 @@
android:id="@+id/tr_list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
<android.support.v4.widget.SwipeRefreshLayout
@ -60,6 +62,7 @@
android:id="@+id/m_list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
</FrameLayout>

View File

@ -44,6 +44,7 @@
android:layout_height="@dimen/profile_image"
android:layout_marginEnd="5dp"
android:contentDescription="@string/profile_image" />
</android.support.v7.widget.CardView>
<LinearLayout
@ -73,6 +74,7 @@
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:singleLine="true" />
</LinearLayout>
<LinearLayout
@ -96,6 +98,7 @@
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:singleLine="true" />
</LinearLayout>
<LinearLayout
@ -131,6 +134,7 @@
android:drawablePadding="4dp"
android:drawableStart="@drawable/follower"
android:visibility="invisible" />
</LinearLayout>
</LinearLayout>
@ -188,7 +192,6 @@
android:fillViewport="true"
app:layout_behavior="android.support.design.widget.AppBarLayout$ScrollingViewBehavior">
<TabHost
android:id="@+id/profile_tab"
android:layout_width="match_parent"
@ -218,6 +221,7 @@
android:id="@+id/ht_list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
<android.support.v4.widget.SwipeRefreshLayout
@ -229,6 +233,7 @@
android:id="@+id/hf_list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
</FrameLayout>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent">
<android.support.v7.widget.Toolbar
@ -46,9 +47,9 @@
android:layout_height="match_parent"/>
</FrameLayout>
</LinearLayout>
</TabHost>
</LinearLayout>

View File

@ -74,6 +74,7 @@
android:layout_margin="5dp"
android:layout_weight="1"
android:text="@string/highlight" />
</LinearLayout>
<TextView

View File

@ -218,6 +218,7 @@
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>

View File

@ -11,8 +11,6 @@
<android.support.v7.widget.RecyclerView
android:id="@+id/userlist"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v7.widget.RecyclerView>
android:layout_height="match_parent" />
</LinearLayout>