move settings to drawer header
This commit is contained in:
parent
6e2b220669
commit
ddb72b88ca
@ -43,15 +43,15 @@ public abstract class BaseFeedlistFragment extends Fragment {
|
|||||||
server.setText("");
|
server.setText("");
|
||||||
}
|
}
|
||||||
|
|
||||||
View account = view.findViewById(R.id.drawer_header_account);
|
View settings = view.findViewById(R.id.drawer_settings_btn);
|
||||||
|
|
||||||
account.setOnClickListener(new View.OnClickListener() {
|
settings.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
try {
|
try {
|
||||||
Intent intent = new Intent(Intent.ACTION_VIEW,
|
Intent intent = new Intent(getActivity(),
|
||||||
Uri.parse(prefs.getString("ttrss_url", "")));
|
PreferencesActivity.class);
|
||||||
startActivity(intent);
|
startActivityForResult(intent, 0);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -128,29 +128,6 @@ public abstract class BaseFeedlistFragment extends Fragment {
|
|||||||
counter.setText(R.string.blank);
|
counter.setText(R.string.blank);
|
||||||
}
|
}
|
||||||
|
|
||||||
// settings
|
|
||||||
footer = inflater.inflate(R.layout.feeds_row, list, false);
|
|
||||||
footer.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
Intent intent = new Intent(activity,
|
|
||||||
PreferencesActivity.class);
|
|
||||||
startActivityForResult(intent, 0);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
list.addFooterView(footer);
|
|
||||||
text = (TextView) footer.findViewById(R.id.title);
|
|
||||||
text.setText(R.string.preferences);
|
|
||||||
|
|
||||||
icon = (ImageView) footer.findViewById(R.id.icon);
|
|
||||||
tv = new TypedValue();
|
|
||||||
getActivity().getTheme().resolveAttribute(R.attr.ic_settings, tv, true);
|
|
||||||
icon.setImageResource(tv.resourceId);
|
|
||||||
|
|
||||||
TextView counter = (TextView) footer.findViewById(R.id.unread_counter);
|
|
||||||
counter.setText(R.string.blank);
|
|
||||||
|
|
||||||
} catch (InflateException e) {
|
} catch (InflateException e) {
|
||||||
// welp couldn't inflate header i guess
|
// welp couldn't inflate header i guess
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -1,76 +1,72 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="120dp"
|
android:layout_height="120dp"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:weightSum="1"
|
android:weightSum="1"
|
||||||
android:clickable="false">
|
android:clickable="false">
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:id="@+id/imageView"
|
|
||||||
android:scaleType="fitXY"
|
|
||||||
android:background="?colorPrimaryDark"
|
|
||||||
android:src="?drawer_header" />
|
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="48dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="48dp"
|
android:layout_height="match_parent">
|
||||||
android:background="@drawable/circle_bg"
|
|
||||||
android:clickable="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_marginRight="16dp"
|
|
||||||
android:elevation="8dp">
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/drawer_header_account"
|
android:layout_width="fill_parent"
|
||||||
android:background="@drawable/ripple"
|
android:layout_height="fill_parent"
|
||||||
android:layout_width="36dp"
|
android:id="@+id/imageView"
|
||||||
android:layout_height="36dp"
|
android:scaleType="fitXY"
|
||||||
android:tint="?colorAccent"
|
android:background="?colorPrimaryDark"
|
||||||
android:src="@drawable/ic_account"
|
android:src="?drawer_header" />
|
||||||
android:layout_gravity="center" />
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@drawable/ic_settings"
|
||||||
|
android:id="@+id/drawer_settings_btn"
|
||||||
|
android:layout_gravity="bottom|right"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:layout_marginRight="12dp"
|
||||||
|
android:background="?attr/selectableItemBackground" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="56dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:id="@+id/linearLayout"
|
||||||
|
android:layout_gravity="center_horizontal|bottom">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/drawer_header_login"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:textColor="@android:color/primary_text_dark"
|
||||||
|
android:text="test"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/drawer_header_server"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@android:color/primary_text_dark"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:text="example.org"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:textStyle="normal"
|
||||||
|
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="56dp"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:id="@+id/linearLayout">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/drawer_header_login"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="16dp"
|
|
||||||
android:textColor="@android:color/primary_text_dark"
|
|
||||||
android:text="test"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="bold"
|
|
||||||
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/drawer_header_server"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textColor="@android:color/primary_text_dark"
|
|
||||||
android:layout_marginLeft="16dp"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:text="example.org"
|
|
||||||
android:textSize="14sp"
|
|
||||||
android:textStyle="normal"
|
|
||||||
|
|
||||||
/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
style="?android:attr/progressBarStyleHorizontal"
|
style="?android:attr/progressBarStyleHorizontal"
|
||||||
android:visibility="invisible"
|
android:visibility="invisible"
|
||||||
@ -79,5 +75,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/feeds_loading_bar"
|
android:id="@+id/feeds_loading_bar"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_alignParentBottom="true" />
|
android:layout_alignParentBottom="true"
|
||||||
</RelativeLayout>
|
android:layout_gravity="bottom" />
|
||||||
|
</FrameLayout>
|
Loading…
Reference in New Issue
Block a user