mirror of
https://github.com/leanote/leanote-android.git
synced 2025-10-16 07:19:28 +00:00
笔记预览页面支持横竖屏切换(解决Mathjax的预览不全)
This commit is contained in:
@@ -22,7 +22,8 @@
|
|||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme">
|
||||||
<activity android:name=".ui.LaunchActivity" android:theme="@style/Theme.AppCompat.NoActionBar">
|
<activity android:name=".ui.LaunchActivity" android:theme="@style/Theme.AppCompat.NoActionBar"
|
||||||
|
android:screenOrientation="portrait">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
@@ -31,22 +32,26 @@
|
|||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.edit.NoteEditActivity"
|
android:name=".ui.edit.NoteEditActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:label="@string/edit" />
|
android:label="@string/edit" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.NotePreviewActivity"
|
android:name=".ui.NotePreviewActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:label="@string/preview" />
|
android:label="@string/preview" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.MainActivity"
|
android:name=".ui.MainActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:label="@string/app_name" />
|
android:label="@string/app_name" />
|
||||||
<activity android:name=".ui.SignInActivity" />
|
<activity android:name=".ui.SignInActivity" android:screenOrientation="portrait" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.SettingsActivity"
|
android:name=".ui.SettingsActivity"
|
||||||
android:label="@string/settings" />
|
android:screenOrientation="portrait" android:label="@string/settings" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.AboutActivity"
|
android:name=".ui.AboutActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:label="@string/about" />
|
android:label="@string/about" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.PictureViewerActivity" />
|
android:name=".ui.PictureViewerActivity" android:screenOrientation="portrait" />
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name=".background.NoteSyncService"
|
android:name=".background.NoteSyncService"
|
||||||
@@ -54,7 +59,7 @@
|
|||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:label="NoteSyncService" />
|
android:label="NoteSyncService" />
|
||||||
|
|
||||||
<activity android:name=".ui.SearchActivity" />
|
<activity android:name=".ui.SearchActivity" android:screenOrientation="portrait" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.tencent.bugly.beta.ui.BetaActivity"
|
android:name="com.tencent.bugly.beta.ui.BetaActivity"
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
package org.houxg.leamonax.ui;
|
package org.houxg.leamonax.ui;
|
||||||
|
|
||||||
import android.content.pm.ActivityInfo;
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
@@ -17,7 +16,6 @@ public class BaseActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
getWindow().setStatusBarColor(getResources().getColor(R.color.toolbar));
|
getWindow().setStatusBarColor(getResources().getColor(R.color.toolbar));
|
||||||
}
|
}
|
||||||
|
@@ -2,6 +2,7 @@ package org.houxg.leamonax.ui;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.pm.ActivityInfo;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
@@ -35,6 +36,8 @@ import rx.functions.Action0;
|
|||||||
import rx.functions.Action1;
|
import rx.functions.Action1;
|
||||||
import rx.schedulers.Schedulers;
|
import rx.schedulers.Schedulers;
|
||||||
|
|
||||||
|
import static android.content.res.Configuration.ORIENTATION_PORTRAIT;
|
||||||
|
|
||||||
public class NotePreviewActivity extends BaseActivity implements EditorFragment.EditorFragmentListener {
|
public class NotePreviewActivity extends BaseActivity implements EditorFragment.EditorFragmentListener {
|
||||||
|
|
||||||
private static final String TAG = "NotePreviewActivity:";
|
private static final String TAG = "NotePreviewActivity:";
|
||||||
@@ -84,6 +87,13 @@ public class NotePreviewActivity extends BaseActivity implements EditorFragment.
|
|||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
|
case R.id.action_rotate:
|
||||||
|
if (ORIENTATION_PORTRAIT == getResources().getConfiguration().orientation) {
|
||||||
|
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||||
|
} else {
|
||||||
|
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
case R.id.action_edit:
|
case R.id.action_edit:
|
||||||
startActivityForResult(NoteEditActivity.getOpenIntent(this, mNote.getId(), false), REQ_EDIT);
|
startActivityForResult(NoteEditActivity.getOpenIntent(this, mNote.getId(), false), REQ_EDIT);
|
||||||
return true;
|
return true;
|
||||||
|
@@ -2,6 +2,11 @@
|
|||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_rotate"
|
||||||
|
app:showAsAction="always"
|
||||||
|
android:title="@string/rotate"/>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_edit"
|
android:id="@+id/action_edit"
|
||||||
app:showAsAction="always"
|
app:showAsAction="always"
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
<string name="delete_note">删除笔记</string>
|
<string name="delete_note">删除笔记</string>
|
||||||
<string name="delete_note_failed">删除笔记失败</string>
|
<string name="delete_note_failed">删除笔记失败</string>
|
||||||
<string name="edit">编辑</string>
|
<string name="edit">编辑</string>
|
||||||
|
<string name="rotate">旋转</string>
|
||||||
<string name="editor">编辑器</string>
|
<string name="editor">编辑器</string>
|
||||||
<string name="email">邮箱</string>
|
<string name="email">邮箱</string>
|
||||||
<string name="email_or_password_incorrect">邮箱或密码错误</string>
|
<string name="email_or_password_incorrect">邮箱或密码错误</string>
|
||||||
|
@@ -8,6 +8,7 @@
|
|||||||
<string name="revert">Revert</string>
|
<string name="revert">Revert</string>
|
||||||
<string name="reverting">Reverting</string>
|
<string name="reverting">Reverting</string>
|
||||||
<string name="edit">Edit</string>
|
<string name="edit">Edit</string>
|
||||||
|
<string name="rotate">Rotate</string>
|
||||||
<string name="link">Link</string>
|
<string name="link">Link</string>
|
||||||
<string name="confirm">Confirm</string>
|
<string name="confirm">Confirm</string>
|
||||||
<string name="cancel">Cancel</string>
|
<string name="cancel">Cancel</string>
|
||||||
|
Reference in New Issue
Block a user