Advanced option for close/back buttons on the bottom.

captchafix
Sietsem 11 years ago
parent 1c0dbec0aa
commit 2a56fa1fe9
  1. 4
      Clover/app/src/main/java/org/floens/chan/core/ChanPreferences.java
  2. 8
      Clover/app/src/main/java/org/floens/chan/ui/fragment/PostRepliesFragment.java
  3. 89
      Clover/app/src/main/res/layout/post_replies_bottombuttons.xml
  4. 2
      Clover/app/src/main/res/values/strings.xml
  5. 4
      Clover/app/src/main/res/xml/preference_advanced.xml

@ -173,6 +173,10 @@ public class ChanPreferences {
return p().getBoolean("preference_anonymize_ids", false);
}
public static boolean getReplyButtonsBottom() {
return p().getBoolean("preference_buttons_bottom", false);
}
public static String getBoardMode() {
return p().getString("preference_board_mode", "catalog");
}

@ -30,6 +30,7 @@ import android.widget.ListView;
import android.widget.TextView;
import org.floens.chan.R;
import org.floens.chan.core.ChanPreferences;
import org.floens.chan.core.manager.ThreadManager;
import org.floens.chan.core.model.Post;
import org.floens.chan.ui.view.PostView;
@ -78,7 +79,12 @@ public class PostRepliesFragment extends DialogFragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup unused, Bundle savedInstanceState) {
View container = inflater.inflate(R.layout.post_replies, null);
View container;
if (ChanPreferences.getReplyButtonsBottom()) {
container = inflater.inflate(R.layout.post_replies_bottombuttons, null);
} else {
container = inflater.inflate(R.layout.post_replies, null);
}
listView = (ListView) container.findViewById(R.id.post_list);

@ -0,0 +1,89 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Clover - 4chan browser https://github.com/Floens/Clover/
Copyright (C) 2014 Floens
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minWidth="320dp"
android:minHeight="200dp"
android:orientation="vertical">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.1"
>
<ListView
android:id="@+id/post_list"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false"
android:orientation="horizontal"
android:divider="?android:attr/dividerVertical"
android:showDividers="middle"
android:dividerPadding="12dp">
<FrameLayout
style="?android:actionButtonStyle"
android:id="@+id/replies_back"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<TextView
style="?android:actionBarTabTextStyle"
android:id="@+id/replies_back_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingRight="20dp"
android:drawableLeft="@drawable/ic_action_back"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:text="@string/back"/>
</FrameLayout>
<FrameLayout
style="?android:actionButtonStyle"
android:id="@+id/replies_close"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<TextView
style="?android:actionBarTabTextStyle"
android:id="@+id/replies_close_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingRight="20dp"
android:drawableLeft="@drawable/ic_action_done"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:text="@string/close"/>
</FrameLayout>
</LinearLayout>
</LinearLayout>

@ -224,6 +224,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<string name="preference_anonymize">Make everyone Anonymous</string>
<string name="preference_anonymize_ids">Hide IDs</string>
<string name="preference_buttons_bottom">Reply buttons on the bottom</string>
<string name="open_link_confirmation">Open link?</string>
<string name="open_thread_confirmation">Open this thread?</string>

@ -53,4 +53,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:key="preference_anonymize_ids"
android:title="@string/preference_anonymize_ids" />
<CheckBoxPreference
android:defaultValue="false"
android:key="preference_buttons_bottom"
android:title="@string/preference_buttons_bottom" />
</PreferenceScreen>

Loading…
Cancel
Save