parent
6654c2c335
commit
2bbe615d57
|
@ -7,6 +7,7 @@ import android.support.design.widget.AppBarLayout;
|
||||||
import android.support.v4.widget.SwipeRefreshLayout;
|
import android.support.v4.widget.SwipeRefreshLayout;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -116,10 +117,18 @@ public class UserProfile extends AppCompatActivity implements View.OnClickListen
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
switch(parent.getId()) {
|
TimelineAdapter tlAdp;
|
||||||
case R.id.ht_list:
|
|
||||||
if(!homeReload.isRefreshing()) {
|
if(parent.getId() == R.id.ht_list) {
|
||||||
TimelineAdapter tlAdp = (TimelineAdapter) homeTweets.getAdapter();
|
tlAdp = (TimelineAdapter) homeTweets.getAdapter();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
tlAdp = (TimelineAdapter) homeFavorits.getAdapter();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(position >= tlAdp.getCount()) {
|
||||||
|
|
||||||
|
} else {
|
||||||
TweetDatabase twDB = tlAdp.getData();
|
TweetDatabase twDB = tlAdp.getData();
|
||||||
long tweetID = twDB.getTweetId(position);
|
long tweetID = twDB.getTweetId(position);
|
||||||
long userID = twDB.getUserID(position);
|
long userID = twDB.getUserID(position);
|
||||||
|
@ -130,22 +139,6 @@ public class UserProfile extends AppCompatActivity implements View.OnClickListen
|
||||||
intent.putExtras(bundle);
|
intent.putExtras(bundle);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case R.id.hf_list:
|
|
||||||
if(!favoriteReload.isRefreshing()) {
|
|
||||||
TimelineAdapter tlAdp = (TimelineAdapter) homeFavorits.getAdapter();
|
|
||||||
TweetDatabase twDB = tlAdp.getData();
|
|
||||||
long tweetID = twDB.getTweetId(position);
|
|
||||||
long userID = twDB.getUserID(position);
|
|
||||||
Intent intent = new Intent(getApplicationContext(), TweetDetail.class);
|
|
||||||
Bundle bundle = new Bundle();
|
|
||||||
bundle.putLong("tweetID",tweetID);
|
|
||||||
bundle.putLong("userID",userID);
|
|
||||||
intent.putExtras(bundle);
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -169,13 +162,16 @@ public class UserProfile extends AppCompatActivity implements View.OnClickListen
|
||||||
currentTab = tabId;
|
currentTab = tabId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deaktiviert
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void onOffsetChanged(AppBarLayout mBar, int high) {
|
public void onOffsetChanged(AppBarLayout mBar, int high) {
|
||||||
int max = - mBar.getTotalScrollRange();
|
int max = - mBar.getTotalScrollRange();
|
||||||
if(high == max) {
|
if(high == max) {
|
||||||
homeTweets.setNestedScrollingEnabled(true);
|
homeTweets.setNestedScrollingEnabled(true);
|
||||||
homeFavorits.setNestedScrollingEnabled(true);
|
homeFavorits.setNestedScrollingEnabled(true);
|
||||||
} else {
|
} else if (high == 0) {
|
||||||
homeTweets.setNestedScrollingEnabled(false);
|
homeTweets.setNestedScrollingEnabled(false);
|
||||||
homeFavorits.setNestedScrollingEnabled(false);
|
homeFavorits.setNestedScrollingEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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="M4.516,7.548c0.436,-0.446 1.043,-0.481 1.576,0L10,11.295l3.908,-3.747c0.533,-0.481 1.141,-0.446 1.574,0c0.436,0.445 0.408,1.197 0,1.615c-0.406,0.418 -4.695,4.502 -4.695,4.502C10.57,13.888 10.285,14 10,14s-0.57,-0.112 -0.789,-0.335c0,0 -4.287,-4.084 -4.695,-4.502C4.107,8.745 4.08,7.993 4.516,7.548z"/>
|
||||||
|
</vector>
|
|
@ -0,0 +1,15 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout 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="64dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/downarrow"
|
||||||
|
android:layout_width="32dp"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:contentDescription="@string/downarrow"
|
||||||
|
app:srcCompat="@drawable/downarrow" />
|
||||||
|
</LinearLayout>
|
|
@ -7,7 +7,7 @@
|
||||||
android:fitsSystemWindows="true">
|
android:fitsSystemWindows="true">
|
||||||
|
|
||||||
<android.support.design.widget.AppBarLayout
|
<android.support.design.widget.AppBarLayout
|
||||||
android:id="@+id/appbar"
|
android:id="@+id/tweetwindow"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
|
@ -94,19 +94,15 @@
|
||||||
android:linksClickable="false"
|
android:linksClickable="false"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
<TableLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
<TableRow
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/tweet_image"
|
android:id="@+id/tweet_image"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="5dp"
|
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:contentDescription="@string/tweet_image"
|
android:contentDescription="@string/tweet_image"
|
||||||
app:srcCompat="@android:color/black" />
|
app:srcCompat="@android:color/black" />
|
||||||
|
@ -115,21 +111,20 @@
|
||||||
android:id="@+id/tweet_image2"
|
android:id="@+id/tweet_image2"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="5dp"
|
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:contentDescription="@string/tweet_image"
|
android:contentDescription="@string/tweet_image"
|
||||||
app:srcCompat="@android:color/black" />
|
app:srcCompat="@android:color/black" />
|
||||||
</TableRow>
|
</LinearLayout>
|
||||||
|
|
||||||
<TableRow
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/tweet_image3"
|
android:id="@+id/tweet_image3"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="5dp"
|
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:contentDescription="@string/tweet_image"
|
android:contentDescription="@string/tweet_image"
|
||||||
app:srcCompat="@android:color/black" />
|
app:srcCompat="@android:color/black" />
|
||||||
|
@ -138,13 +133,10 @@
|
||||||
android:id="@+id/tweet_image4"
|
android:id="@+id/tweet_image4"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="5dp"
|
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:contentDescription="@string/tweet_image"
|
android:contentDescription="@string/tweet_image"
|
||||||
app:srcCompat="@android:color/black" />
|
app:srcCompat="@android:color/black" />
|
||||||
</TableRow>
|
</LinearLayout>
|
||||||
|
|
||||||
</TableLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
@ -39,4 +39,5 @@
|
||||||
<string name="verify">Verifiziert</string>
|
<string name="verify">Verifiziert</string>
|
||||||
<string name="yes_confirm">Ja</string>
|
<string name="yes_confirm">Ja</string>
|
||||||
<string name="no_confirm">Nein</string>
|
<string name="no_confirm">Nein</string>
|
||||||
|
<string name="downarrow">Pfeil nach unten</string>
|
||||||
</resources>
|
</resources>
|
Loading…
Reference in New Issue