Add option to force the phone layout.

captchafix
Florens Douwes 11 years ago
parent 7cf58fbfd7
commit bfd2e8ae9f
  1. 4
      Clover/app/src/main/java/org/floens/chan/core/ChanPreferences.java
  2. 7
      Clover/app/src/main/java/org/floens/chan/ui/activity/BoardActivity.java
  3. 2
      Clover/app/src/main/res/values/strings.xml
  4. 5
      Clover/app/src/main/res/xml/preference.xml

@ -119,4 +119,8 @@ public class ChanPreferences {
public static String getTheme() { public static String getTheme() {
return p().getString("preference_theme", "light"); return p().getString("preference_theme", "light");
} }
public static boolean getForcePhoneLayout() {
return p().getBoolean("preference_force_phone_layout", false);
}
} }

@ -44,6 +44,7 @@ import android.widget.TextView;
import org.floens.chan.ChanApplication; import org.floens.chan.ChanApplication;
import org.floens.chan.R; import org.floens.chan.R;
import org.floens.chan.chan.ChanUrls; import org.floens.chan.chan.ChanUrls;
import org.floens.chan.core.ChanPreferences;
import org.floens.chan.core.model.Loadable; import org.floens.chan.core.model.Loadable;
import org.floens.chan.core.model.Pin; import org.floens.chan.core.model.Pin;
import org.floens.chan.core.model.Post; import org.floens.chan.core.model.Post;
@ -254,6 +255,11 @@ public class BoardActivity extends BaseActivity implements AdapterView.OnItemSel
// Nexus 7 is 600 x 960 dp // Nexus 7 is 600 x 960 dp
// Nexus 10 is 800 x 1280 dp // Nexus 10 is 800 x 1280 dp
if (ChanPreferences.getForcePhoneLayout()) {
leftParams.width = width - Utils.dp(30);
rightParams.width = width;
isSlidable = true;
} else {
if (width < Utils.dp(400)) { if (width < Utils.dp(400)) {
leftParams.width = width - Utils.dp(30); leftParams.width = width - Utils.dp(30);
rightParams.width = width; rightParams.width = width;
@ -271,6 +277,7 @@ public class BoardActivity extends BaseActivity implements AdapterView.OnItemSel
rightParams.width = width - Utils.dp(400); rightParams.width = width - Utils.dp(400);
isSlidable = false; isSlidable = false;
} }
}
left.setLayoutParams(leftParams); left.setLayoutParams(leftParams);
right.setLayoutParams(rightParams); right.setLayoutParams(rightParams);

@ -136,6 +136,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<string name="preference_auto_refresh_thread">Auto refresh threads</string> <string name="preference_auto_refresh_thread">Auto refresh threads</string>
<string name="preference_image_auto_load">Auto load images</string> <string name="preference_image_auto_load">Auto load images</string>
<string name="preference_force_phone_layout">Force phone layout</string>
<string name="preference_default_name">Default name</string> <string name="preference_default_name">Default name</string>
<string name="preference_default_email">Default email</string> <string name="preference_default_email">Default email</string>

@ -73,6 +73,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
android:key="preference_auto_refresh_thread" android:key="preference_auto_refresh_thread"
android:title="@string/preference_auto_refresh_thread"/> android:title="@string/preference_auto_refresh_thread"/>
<CheckBoxPreference
android:defaultValue="false"
android:key="preference_force_phone_layout"
android:title="@string/preference_force_phone_layout"/>
<EditTextPreference <EditTextPreference
android:key="preference_default_name" android:key="preference_default_name"
android:title="@string/preference_default_name"/> android:title="@string/preference_default_name"/>

Loading…
Cancel
Save