Skip to content

Commit

Permalink
修复编辑页面滑动卡顿bug,添加第二次打开不激活键盘
Browse files Browse the repository at this point in the history
  • Loading branch information
daimajia committed Sep 29, 2013
1 parent 69f661a commit bad8a1f
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 33 deletions.
5 changes: 3 additions & 2 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:logo="@drawable/ic_launcher"
android:theme="@style/AppTheme" >
<meta-data
android:name="UMENG_APPKEY"
android:value="5227d49556240bb56e0b9713" >
</meta-data>
<meta-data
android:name="UMENG_CHANNEL"
android:value="Debug" />
android:value="Wan_Dou_Jia" />

<provider
android:name="com.zhan_dui.data.MemoProvider"
Expand All @@ -45,7 +46,7 @@
</activity>
<activity
android:name="com.zhan_dui.evermemo.MemoActivity"
android:windowSoftInputMode="stateVisible|adjustResize" >
android:windowSoftInputMode="stateHidden|adjustResize" >
</activity>
<activity android:name="com.zhan_dui.evermemo.SettingActivity" >
</activity>
Expand Down
Binary file added Key
Binary file not shown.
Binary file added res/drawable-ldpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 21 additions & 14 deletions res/layout/activity_memo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<LinearLayout
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/memo_title_bar_height"
android:layout_height="@dimen/memo_inner_title_bar_height"
android:gravity="center"
android:orientation="horizontal"
android:paddingLeft="@dimen/padding_left"
Expand All @@ -55,21 +55,28 @@
</LinearLayout>
</LinearLayout>

<EditText
android:id="@+id/content"
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_height="0dip"
android:layout_weight="1"
android:background="#00000000"
android:gravity="top|left"
android:inputType="textMultiLine"
android:lineSpacingExtra="6dip"
android:paddingBottom="@dimen/edit_padding_bottom"
android:paddingLeft="@dimen/edit_padding_left"
android:paddingRight="@dimen/edit_padding_right"
android:paddingTop="@dimen/edit_padding_top"
android:text="@null"
android:textColor="@color/content_text_color" />
android:scrollbars="vertical" >

<EditText
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#00000000"
android:gravity="top|left"
android:inputType="textMultiLine"
android:lineSpacingExtra="6dip"
android:minHeight="200dp"
android:paddingBottom="@dimen/edit_padding_bottom"
android:paddingLeft="@dimen/edit_padding_left"
android:paddingRight="@dimen/edit_padding_right"
android:paddingTop="@dimen/edit_padding_top"
android:text="@null"
android:textColor="@color/content_text_color" />
</ScrollView>

<RelativeLayout
android:id="@+id/bottom_bar"
Expand Down
3 changes: 2 additions & 1 deletion res/layout/activity_start.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@
xmlns:pla="http://schemas.android.com/apk/res-auto"
android:id="@+id/memos"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/divider_line"
android:paddingLeft="@dimen/grid_padding_left"
android:paddingRight="@dimen/grid_padding_right"
android:scrollbars="vertical"
pla:plaColumnNumber="2"
pla:plaLandscapeColumnNumber="3" >
</com.huewu.pla.lib.MultiColumnListView>
Expand Down
5 changes: 3 additions & 2 deletions res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<dimen name="divider_line_height">1px</dimen>

<!-- Memo GridView -->
<dimen name="grid_padding_left">3dp</dimen>
<dimen name="grid_padding_right">3dp</dimen>
<dimen name="grid_padding_left">1dp</dimen>
<dimen name="grid_padding_right">1dp</dimen>
<!-- Memo GridView -->


Expand Down Expand Up @@ -45,6 +45,7 @@
<dimen name="padding_bottom">13dp</dimen>
<dimen name="tb_icon_size">30dp</dimen>
<dimen name="tb_icon_padding">10dp</dimen>
<dimen name="memo_inner_title_bar_height">36dp</dimen>
<!-- Memo activity -->


Expand Down
10 changes: 1 addition & 9 deletions src/com/zhan_dui/data/Memo.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,7 @@ public void setId(int _id) {
}

public String getTitle() {
// return "EverMemo " + new Date().getDate() + new Date().getHours()
// + new Date().getMinutes();
return "EverMemo";
// String pure = getContent().replaceAll("<.+?>", "");
// BufferedReader reader = new BufferedReader(new StringReader(pure));
// try {
// return reader.readLine();
// } catch (IOException e) {
// return "No Title";
// }
}

public Note toNote(String notebookGuid) {
Expand Down Expand Up @@ -185,6 +176,7 @@ private String convertContentToEvernote() {

public void setContent(String content) {
mContent = content;
Logger.e("下载下来的文本:" + content);
mStatus = STATUS_COMMON;
mOrder = 0;
mAttributes = "";
Expand Down
13 changes: 10 additions & 3 deletions src/com/zhan_dui/evermemo/MemoActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import android.view.View.OnTouchListener;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
Expand Down Expand Up @@ -73,18 +74,21 @@ protected void onCreate(Bundle savedInstanceState) {
overridePendingTransition(R.anim.push_up, R.anim.push_down);
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_memo);
mContentEditText = (EditText) findViewById(R.id.content);
Bundle bundle = getIntent().getExtras();
if (bundle != null && bundle.getSerializable("memo") != null) {
memo = (Memo) bundle.getSerializable("memo");
mCreateNew = false;
mLastSaveContent = memo.getContent();

} else {
memo = new Memo();
mCreateNew = true;
}
setContentView(R.layout.activity_memo);

mDateText = (TextView) findViewById(R.id.time);
mContentEditText = (EditText) findViewById(R.id.content);

mList = (Button) findViewById(R.id.list);
mShare = (Button) findViewById(R.id.share);
mBottomBar = findViewById(R.id.bottom_bar);
Expand All @@ -102,6 +106,9 @@ protected void onCreate(Bundle savedInstanceState) {

if (mCreateNew) {
mDateText.setText(R.string.new_memo);
mContentEditText.requestFocus();
getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
} else {
mDateText.setText(DateHelper.getMemoDate(mContext,
memo.getCreatedTime()));
Expand Down Expand Up @@ -421,7 +428,7 @@ public void UpdateCallback(boolean result, Memo memo, Note data) {
// Toast.makeText(mContext, "修改成功", Toast.LENGTH_SHORT).show();
} else {
// Toast.makeText(mContext, "修改失败", Toast.LENGTH_SHORT).show();

}
}

Expand Down
1 change: 1 addition & 0 deletions src/com/zhan_dui/evermemo/StartActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ protected void onCreate(Bundle savedInstanceState) {
manager.initLoader(1, null, this);
mSharedPreferences = PreferenceManager
.getDefaultSharedPreferences(mContext);


if (mSharedPreferences.getInt(sStartCount, 1) == 1) {
mBindEvernotePanel.startAnimation(new MarginAnimation(
Expand Down
2 changes: 1 addition & 1 deletion src/com/zhan_dui/sync/Evernote.java
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ public void onFinshed(boolean result, Memo task) {
}
};

private void createNote(Memo memo, String notebookGuid) {
public void createNote(Memo memo, String notebookGuid) {
if (mEvernoteSession.isLoggedIn()) {
Logger.e(LogTag, "授权可用");
checkAndInsert(notebookGuid, memo);
Expand Down
2 changes: 1 addition & 1 deletion src/com/zhan_dui/utils/Logger.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

public class Logger {

public static Boolean DEBUG = true;
public static Boolean DEBUG = false;
public static String Tag = "调试信息";
public static String[] Filters = { MemoActivity.LogTag };

Expand Down

1 comment on commit bad8a1f

@jijiaxin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

跑不起来,楼主能否更新一下这个项目呢

Please sign in to comment.