修复部分bug

cqy_branch
chenqy 3 years ago
parent 859bb8a892
commit 22d2b91d09

@ -1,6 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<runningDeviceTargetSelectedWithDropDown>
<Target>
<type value="RUNNING_DEVICE_TARGET" />
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="C:\Users\Administrator\.android\avd\Pixel_XL_API_33.avd" />
</Key>
</deviceKey>
</Target>
</runningDeviceTargetSelectedWithDropDown>
<targetSelectedWithDropDown>
<Target>
<type value="QUICK_BOOT_TARGET" />
@ -12,6 +23,6 @@
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2023-05-21T06:48:03.921635200Z" />
<timeTargetWasSelectedWithDropDown value="2023-05-21T11:47:08.208041300Z" />
</component>
</project>

@ -1,4 +1,4 @@
#Sun May 21 18:10:27 CST 2023
#Sun May 21 19:54:46 CST 2023
path.4=13/classes.dex
path.3=12/classes.dex
path.2=11/classes.dex

@ -1724,109 +1724,109 @@ int drawable edit_white 0x7f08007b
int drawable edit_yellow 0x7f08007c
int drawable fire_1 0x7f08007d
int drawable fire_2 0x7f08007e
int drawable font_large 0x7f080080
int drawable font_normal 0x7f080081
int drawable font_size_selector_bg 0x7f080082
int drawable font_small 0x7f080083
int drawable font_super 0x7f080084
int drawable ic_clock_black_24dp 0x7f080085
int drawable ic_keyboard_black_24dp 0x7f080086
int drawable ic_mtrl_checked_circle 0x7f080087
int drawable ic_mtrl_chip_checked_black 0x7f080088
int drawable ic_mtrl_chip_checked_circle 0x7f080089
int drawable ic_mtrl_chip_close_circle 0x7f08008a
int drawable icon_app 0x7f08008b
int drawable list_background 0x7f08008c
int drawable list_blue_down 0x7f08008d
int drawable list_blue_middle 0x7f08008e
int drawable list_blue_single 0x7f08008f
int drawable list_blue_up 0x7f080090
int drawable list_folder 0x7f080091
int drawable list_footer_bg 0x7f080092
int drawable list_green_down 0x7f080093
int drawable list_green_middle 0x7f080094
int drawable list_green_single 0x7f080095
int drawable list_green_up 0x7f080096
int drawable list_red_down 0x7f080097
int drawable list_red_middle 0x7f080098
int drawable list_red_single 0x7f080099
int drawable list_red_up 0x7f08009a
int drawable list_white_down 0x7f08009b
int drawable list_white_middle 0x7f08009c
int drawable list_white_single 0x7f08009d
int drawable list_white_up 0x7f08009e
int drawable list_yellow_down 0x7f08009f
int drawable list_yellow_middle 0x7f0800a0
int drawable list_yellow_single 0x7f0800a1
int drawable list_yellow_up 0x7f0800a2
int drawable login_input_style 0x7f0800a3
int drawable material_cursor_drawable 0x7f0800a4
int drawable material_ic_calendar_black_24dp 0x7f0800a5
int drawable material_ic_clear_black_24dp 0x7f0800a6
int drawable material_ic_edit_black_24dp 0x7f0800a7
int drawable material_ic_keyboard_arrow_left_black_24dp 0x7f0800a8
int drawable material_ic_keyboard_arrow_next_black_24dp 0x7f0800a9
int drawable material_ic_keyboard_arrow_previous_black_24dp 0x7f0800aa
int drawable material_ic_keyboard_arrow_right_black_24dp 0x7f0800ab
int drawable material_ic_menu_arrow_down_black_24dp 0x7f0800ac
int drawable material_ic_menu_arrow_up_black_24dp 0x7f0800ad
int drawable menu_delete 0x7f0800ae
int drawable menu_move 0x7f0800af
int drawable mtrl_dialog_background 0x7f0800b0
int drawable mtrl_dropdown_arrow 0x7f0800b1
int drawable mtrl_ic_arrow_drop_down 0x7f0800b2
int drawable mtrl_ic_arrow_drop_up 0x7f0800b3
int drawable mtrl_ic_cancel 0x7f0800b4
int drawable mtrl_ic_error 0x7f0800b5
int drawable mtrl_navigation_bar_item_background 0x7f0800b6
int drawable mtrl_popupmenu_background 0x7f0800b7
int drawable mtrl_popupmenu_background_dark 0x7f0800b8
int drawable mtrl_tabs_default_indicator 0x7f0800b9
int drawable navigation_empty_icon 0x7f0800ba
int drawable new_note 0x7f0800bb
int drawable new_note_normal 0x7f0800bc
int drawable new_note_pressed 0x7f0800bd
int drawable note_btn_lf 0x7f0800be
int drawable note_btn_main 0x7f0800bf
int drawable note_btn_rt 0x7f0800c0
int drawable note_edit_color_selector_panel 0x7f0800c1
int drawable note_menu_bg 0x7f0800c2
int drawable notification 0x7f0800c3
int drawable notification_action_background 0x7f0800c4
int drawable notification_bg 0x7f0800c5
int drawable notification_bg_low 0x7f0800c6
int drawable notification_bg_low_normal 0x7f0800c7
int drawable notification_bg_low_pressed 0x7f0800c8
int drawable notification_bg_normal 0x7f0800c9
int drawable notification_bg_normal_pressed 0x7f0800ca
int drawable notification_icon_background 0x7f0800cb
int drawable notification_template_icon_bg 0x7f0800cc
int drawable notification_template_icon_low_bg 0x7f0800cd
int drawable notification_tile_bg 0x7f0800ce
int drawable notify_panel_notification_icon_bg 0x7f0800cf
int drawable pin 0x7f0800d0
int drawable pin_active 0x7f0800d1
int drawable pin_bg 0x7f0800d2
int drawable search_result 0x7f0800d3
int drawable selected 0x7f0800d4
int drawable test_custom_background 0x7f0800d5
int drawable title_alert 0x7f0800d6
int drawable title_bar_bg 0x7f0800d7
int drawable tooltip_frame_dark 0x7f0800d8
int drawable tooltip_frame_light 0x7f0800d9
int drawable verify_btn_bg 0x7f0800da
int drawable verify_btn_normal 0x7f0800db
int drawable verify_btn_pressed 0x7f0800dc
int drawable widget_2x_blue 0x7f0800dd
int drawable widget_2x_green 0x7f0800de
int drawable widget_2x_red 0x7f0800df
int drawable widget_2x_white 0x7f0800e0
int drawable widget_2x_yellow 0x7f0800e1
int drawable widget_4x_blue 0x7f0800e2
int drawable widget_4x_green 0x7f0800e3
int drawable widget_4x_red 0x7f0800e4
int drawable widget_4x_white 0x7f0800e5
int drawable widget_4x_yellow 0x7f0800e6
int drawable font_large 0x7f08007f
int drawable font_normal 0x7f080080
int drawable font_size_selector_bg 0x7f080081
int drawable font_small 0x7f080082
int drawable font_super 0x7f080083
int drawable ic_clock_black_24dp 0x7f080084
int drawable ic_keyboard_black_24dp 0x7f080085
int drawable ic_mtrl_checked_circle 0x7f080086
int drawable ic_mtrl_chip_checked_black 0x7f080087
int drawable ic_mtrl_chip_checked_circle 0x7f080088
int drawable ic_mtrl_chip_close_circle 0x7f080089
int drawable icon_app 0x7f08008a
int drawable list_background 0x7f08008b
int drawable list_blue_down 0x7f08008c
int drawable list_blue_middle 0x7f08008d
int drawable list_blue_single 0x7f08008e
int drawable list_blue_up 0x7f08008f
int drawable list_folder 0x7f080090
int drawable list_footer_bg 0x7f080091
int drawable list_green_down 0x7f080092
int drawable list_green_middle 0x7f080093
int drawable list_green_single 0x7f080094
int drawable list_green_up 0x7f080095
int drawable list_red_down 0x7f080096
int drawable list_red_middle 0x7f080097
int drawable list_red_single 0x7f080098
int drawable list_red_up 0x7f080099
int drawable list_white_down 0x7f08009a
int drawable list_white_middle 0x7f08009b
int drawable list_white_single 0x7f08009c
int drawable list_white_up 0x7f08009d
int drawable list_yellow_down 0x7f08009e
int drawable list_yellow_middle 0x7f08009f
int drawable list_yellow_single 0x7f0800a0
int drawable list_yellow_up 0x7f0800a1
int drawable login_input_style 0x7f0800a2
int drawable material_cursor_drawable 0x7f0800a3
int drawable material_ic_calendar_black_24dp 0x7f0800a4
int drawable material_ic_clear_black_24dp 0x7f0800a5
int drawable material_ic_edit_black_24dp 0x7f0800a6
int drawable material_ic_keyboard_arrow_left_black_24dp 0x7f0800a7
int drawable material_ic_keyboard_arrow_next_black_24dp 0x7f0800a8
int drawable material_ic_keyboard_arrow_previous_black_24dp 0x7f0800a9
int drawable material_ic_keyboard_arrow_right_black_24dp 0x7f0800aa
int drawable material_ic_menu_arrow_down_black_24dp 0x7f0800ab
int drawable material_ic_menu_arrow_up_black_24dp 0x7f0800ac
int drawable menu_delete 0x7f0800ad
int drawable menu_move 0x7f0800ae
int drawable mtrl_dialog_background 0x7f0800af
int drawable mtrl_dropdown_arrow 0x7f0800b0
int drawable mtrl_ic_arrow_drop_down 0x7f0800b1
int drawable mtrl_ic_arrow_drop_up 0x7f0800b2
int drawable mtrl_ic_cancel 0x7f0800b3
int drawable mtrl_ic_error 0x7f0800b4
int drawable mtrl_navigation_bar_item_background 0x7f0800b5
int drawable mtrl_popupmenu_background 0x7f0800b6
int drawable mtrl_popupmenu_background_dark 0x7f0800b7
int drawable mtrl_tabs_default_indicator 0x7f0800b8
int drawable navigation_empty_icon 0x7f0800b9
int drawable new_note 0x7f0800ba
int drawable new_note_normal 0x7f0800bb
int drawable new_note_pressed 0x7f0800bc
int drawable note_btn_lf 0x7f0800bd
int drawable note_btn_main 0x7f0800be
int drawable note_btn_rt 0x7f0800bf
int drawable note_edit_color_selector_panel 0x7f0800c0
int drawable note_menu_bg 0x7f0800c1
int drawable notification 0x7f0800c2
int drawable notification_action_background 0x7f0800c3
int drawable notification_bg 0x7f0800c4
int drawable notification_bg_low 0x7f0800c5
int drawable notification_bg_low_normal 0x7f0800c6
int drawable notification_bg_low_pressed 0x7f0800c7
int drawable notification_bg_normal 0x7f0800c8
int drawable notification_bg_normal_pressed 0x7f0800c9
int drawable notification_icon_background 0x7f0800ca
int drawable notification_template_icon_bg 0x7f0800cb
int drawable notification_template_icon_low_bg 0x7f0800cc
int drawable notification_tile_bg 0x7f0800cd
int drawable notify_panel_notification_icon_bg 0x7f0800ce
int drawable pin 0x7f0800cf
int drawable pin_active 0x7f0800d0
int drawable pin_bg 0x7f0800d1
int drawable search_result 0x7f0800d2
int drawable selected 0x7f0800d3
int drawable test_custom_background 0x7f0800d4
int drawable title_alert 0x7f0800d5
int drawable title_bar_bg 0x7f0800d6
int drawable tooltip_frame_dark 0x7f0800d7
int drawable tooltip_frame_light 0x7f0800d8
int drawable verify_btn_bg 0x7f0800d9
int drawable verify_btn_normal 0x7f0800da
int drawable verify_btn_pressed 0x7f0800db
int drawable widget_2x_blue 0x7f0800dc
int drawable widget_2x_green 0x7f0800dd
int drawable widget_2x_red 0x7f0800de
int drawable widget_2x_white 0x7f0800df
int drawable widget_2x_yellow 0x7f0800e0
int drawable widget_4x_blue 0x7f0800e1
int drawable widget_4x_green 0x7f0800e2
int drawable widget_4x_red 0x7f0800e3
int drawable widget_4x_white 0x7f0800e4
int drawable widget_4x_yellow 0x7f0800e5
int font consolas 0x7f090000
int font font_consolas 0x7f090001
int id ALT 0x7f0a0000

@ -64,7 +64,9 @@ public class BackupBoundService extends Service {
String phone = Auth.getAuthToken(this, Auth.AUTH_PHONE_KEY);
HttpUrl url = HttpUrl.parse(NoteRemoteConfig.generateUrl("/note/syncnote"));
int count = 0;
for (Long noteId : noteData) {
count++;
JSONObject body = new JSONObject();
body.put("user_id", phone);
@ -96,11 +98,12 @@ public class BackupBoundService extends Service {
body.put("note_token", noteToken);
}
int finalCount = count;
noteHttpServer.sendAsyncPostRequest(url, body.toString(), NoteHttpServer.BodyType.JSON, new Callback() {
@Override
public void onFailure(@NotNull Call call, @NotNull IOException e) {
Log.e(TAG, "Backup failed: " + e.getMessage());
mHandler.obtainMessage(1, "Backup failed: " + e.getMessage()).sendToTarget();
mHandler.obtainMessage(1, "第"+ finalCount +"条便签备份失败: " + e.getMessage()).sendToTarget();
}
@Override
@ -114,7 +117,7 @@ public class BackupBoundService extends Service {
if (noteToken == null) {
Log.e(TAG, "Backup failed");
mHandler.obtainMessage(1, "Backup failed").sendToTarget();
mHandler.obtainMessage(1, "第"+ finalCount +"条便签备份失败: ").sendToTarget();
} else {
ContentValues values = new ContentValues();
values.put(Notes.DataColumns.DATA5, noteToken);
@ -124,14 +127,14 @@ public class BackupBoundService extends Service {
Notes.DataColumns.NOTE_ID + " = ?",
new String[]{noteId.toString()}
);
mHandler.obtainMessage(1, "Backup successful").sendToTarget();
}
} catch (JSONException e) {
mHandler.obtainMessage(1, "Backup failed: " + e.getMessage()).sendToTarget();
mHandler.obtainMessage(1, "第"+ finalCount +"条便签备份失败: " + e.getMessage()).sendToTarget();
}
}
});
}
mHandler.obtainMessage(1, "备份结束").sendToTarget();
}
public class LocalBinder extends Binder {

@ -114,15 +114,12 @@ public class NoteDelButton extends androidx.appcompat.widget.AppCompatButton imp
@Override
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
try {
JSONObject resJson = new JSONObject(response.body().string());
if (resJson.getInt("code") == NoteRemoteConfig.RESPONSE_SUCCESS) {
UIUtils.sendMsg((Activity) context, "删除成功");
if(response.code() == NoteRemoteConfig.RESPONSE_SUCCESS){
UIUtils.sendMsg((Activity) context, "删除成功");
UIUtils.runInUI((Activity) context,() -> {
adapter.deleteItem(item);
} else {
UIUtils.sendMsg((Activity) context, "删除失败");
}
} catch (JSONException e) {
});
}else{
UIUtils.sendMsg((Activity) context, "删除失败");
}
}

@ -119,7 +119,7 @@ public class NoteEditActivity extends Activity implements OnClickListener,
sFontSelectorSelectionMap.put(ResourceParser.TEXT_SUPER, R.id.iv_super_select);
}
private static final String TAG = "NoteEditActivity";
private static final String TAG = "chenqy";
private HeadViewHolder mNoteHeaderHolder;
@ -419,7 +419,7 @@ public class NoteEditActivity extends Activity implements OnClickListener,
if (mFontSizeId >= TextAppearanceResources.getResourcesSize()) {
mFontSizeId = ResourceParser.BG_DEFAULT_FONT_SIZE;
}
mEditTextList = (LinearLayout) findViewById(R.id.note_edit_list);
mEditTextList = findViewById(R.id.note_edit_list);
//custom
initPinCheckbox();
@ -435,12 +435,13 @@ public class NoteEditActivity extends Activity implements OnClickListener,
pinCheckBox.setOnCheckedChangeListener((buttonView, isChecked) -> {
ContentValues val = new ContentValues();
val.put(Notes.NoteColumns.PIN, isChecked ? 1 : 0);
boolean b = getContentResolver().update(
ContentUris.withAppendedId(Notes.CONTENT_NOTE_URI, mWorkingNote.getNoteId()), val, null,
null) == 0;
if (b) {
Toast.makeText(NoteEditActivity.this, "Pin failed", Toast.LENGTH_SHORT).show();
long note_id = mWorkingNote.getNoteId();
if(note_id != 0){
//新创建的note,不需要更新数据库
// 因为在保存的时候会更新,老的note需要更新数据库
getContentResolver().update(Notes.CONTENT_NOTE_URI, val, Notes.NoteColumns.ID + "=?", new String[]{String.valueOf(note_id)});
}
});
}
@ -774,7 +775,6 @@ public class NoteEditActivity extends Activity implements OnClickListener,
private View getListItem(String item, int index) {
View view = LayoutInflater.from(this).inflate(R.layout.note_edit_list_item, null);
ImageView pin_fire = view.findViewById(R.id.pin_fire);
final NoteEditText edit = (NoteEditText) view.findViewById(R.id.et_edit_text);
edit.setTextAppearance(this, TextAppearanceResources.getTexAppearanceResource(mFontSizeId));
CheckBox cb = ((CheckBox) view.findViewById(R.id.cb_edit_item));
@ -865,10 +865,27 @@ public class NoteEditActivity extends Activity implements OnClickListener,
* {@link #RESULT_OK} is used to identify the create/edit state
*/
setResult(RESULT_OK);
saveNotePin();
}
return saved;
}
private void saveNotePin(){
//update pin
if (pinCheckBox.isChecked()){
ContentValues values = new ContentValues();
values.put(Notes.NoteColumns.PIN, pinCheckBox.isChecked()?1:0);
long note_id = mWorkingNote.getNoteId();
int update = getContentResolver().update(
Notes.CONTENT_NOTE_URI,
values,
Notes.NoteColumns.ID + " = ?",
new String[]{String.valueOf(note_id)}
);
Log.e(TAG, "update pin " + update);
}
}
private void sendToDesktop() {
/**
* Before send message to home, we should make sure that current

@ -75,7 +75,6 @@ public class NoteLoginActivity extends Activity {
rlContent = findViewById(R.id.btn_login_area);
rlContent.getBackground().setAlpha(0);
handler = new Handler();
}
private void initResources() {
@ -97,12 +96,18 @@ public class NoteLoginActivity extends Activity {
}
});
//设置phone
//如果携带了phone信息
Intent intent = getIntent();
String phone = intent.getStringExtra("phone");
if (phone != null) {
note_login_phone_num.setText(phone);
}
//有缓存
String cachePhone = Auth.getAuthToken(this, Auth.AUTH_PHONE_KEY);
if (cachePhone != null){
note_login_phone_num.setText(cachePhone);
}
}

@ -72,8 +72,6 @@ public class NotesListItem extends LinearLayout {
* @param checked
*/
public void bind(Context context, NoteItemData data, boolean choiceMode, boolean checked) {
pin_fire.setTag(data.getId());
pin_fire.run();
// 根据RecyclerView是否处于选择模式以及笔记项类型显示或隐藏复选框。
if (choiceMode && data.getType() == Notes.TYPE_NOTE) {
mCheckBox.setVisibility(View.VISIBLE);
@ -111,6 +109,8 @@ public class NotesListItem extends LinearLayout {
+ context.getString(R.string.format_folder_files_count, data.getNotesCount()));
mAlert.setVisibility(View.GONE); // 隐藏警报图标。
} else { // 如果笔记项不是文件夹,说明是笔记
pin_fire.setTag(data.getId());
pin_fire.run();
mTitle.setText(DataUtils.getFormattedSnippet(data.getSnippet())); // 将标题文本设置为笔记项的格式化片段。
if (data.hasAlert()) { // 如果笔记项有警报,
mAlert.setImageResource(R.drawable.clock); // 将警报图标设置为时钟图标。

@ -47,14 +47,15 @@ public class PinFireImagView extends androidx.appcompat.widget.AppCompatImageVie
//find pin
Cursor c = context.getContentResolver().query(Notes.CONTENT_NOTE_URI, new String[]{Notes.NoteColumns.PIN}, Notes.NoteColumns.ID + " = ?", new String[]{String.valueOf(note_id)}, null);
if (c != null) {
c.moveToFirst();
@SuppressLint("Range") int pin = c.getInt(c.getColumnIndex(Notes.NoteColumns.PIN));
if (pin == 1) {
this.setVisibility(VISIBLE);
background.start();
} else {
background.stop();
this.setVisibility(GONE);
if(c.moveToFirst()){
@SuppressLint("Range") int pin = c.getInt(c.getColumnIndex(Notes.NoteColumns.PIN));
if (pin == 1) {
this.setVisibility(VISIBLE);
background.start();
} else {
background.stop();
this.setVisibility(GONE);
}
}
c.close();
}

Loading…
Cancel
Save