团队冲刺第二阶段01

徐姣美:今天计划完善密码设置的内容,完成了密码设置的布局。较第一阶段的内容添加了密保问题。

代码:

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:pixlui="http://schemas.android.com/apk/com.neopixl.pixlui"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <ScrollView
        android:id="@+id/password_root"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="@dimen/activity_horizontal_margin"
        android:scrollbarSize="4dp"
        android:scrollbarStyle="outsideOverlay"
        android:scrollbarThumbVertical="@drawable/scroll_bar">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <com.neopixl.pixlui.components.textview.TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/settings_password_instructions"
                android:textColor="@color/text_gray"
                android:textSize="15sp"
                pixlui:typeface="Roboto-Regular.ttf" />

            <EditText
                android:id="@+id/password"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                android:gravity="center_horizontal"
                android:hint="@string/insert_new_password"
                android:inputType="textPassword"
                style="@style/Text.Normal" />

            <EditText
                android:id="@+id/password_check"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="10dp"
                android:gravity="center_horizontal"
                android:hint="@string/confirm_new_password"
                android:inputType="textPassword"
                style="@style/Text.Normal" />

            <com.neopixl.pixlui.components.textview.TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="20dp"
                android:text="@string/settings_password_question_instructions"
                android:textColor="@color/text_gray"
                android:textSize="15sp"
                pixlui:typeface="Roboto-Regular.ttf" />

            <EditText
                android:id="@+id/question"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                android:gravity="center_horizontal"
                android:singleLine="true"
                android:hint="@string/settings_password_question"
                style="@style/Text.Normal" />

            <EditText
                android:id="@+id/answer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="10dp"
                android:gravity="center_horizontal"
                android:hint="@string/settings_password_answer"
                android:inputType="textPassword"
                style="@style/Text.Normal" />

            <EditText
                android:id="@+id/answer_check"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="10dp"
                android:gravity="center_horizontal"
                android:hint="@string/settings_password_answer_check"
                android:inputType="textPassword"
                style="@style/Text.Normal" />

            <include layout="@layout/password_buttons" />

        </LinearLayout>

    </ScrollView>

    <include
        android:id="@+id/crouton_handle"
        layout="@layout/crouton_handle" />

</RelativeLayout>

深澳宇:今天做了便签的分类,可以添加类别、移除类别。

代码:

  @OnClick(R.id.save)
  public void saveCategory () {

    if (title.getText().toString().length() == 0) {
      title.setError(getString(R.string.category_missing_title));
      return;
    }

    Long id = category.getId() != null ? category.getId() : Calendar.getInstance().getTimeInMillis();
    category.setId(id);
    category.setName(title.getText().toString());
    category.setDescription(description.getText().toString());
    if (selectedColor != 0 || category.getColor() == null) {
      category.setColor(String.valueOf(selectedColor));
    }

    // Saved to DB and new ID or update result catched
    DbHelper db = DbHelper.getInstance();
    category = db.updateCategory(category);

    // Sets result to show proper message
    getIntent().putExtra(INTENT_CATEGORY, category);
    setResult(RESULT_OK, getIntent());
    finish();
  }


  @OnClick(R.id.delete)
  public void deleteCategory () {

    new MaterialDialog.Builder(this)
        .title(R.string.delete_unused_category_confirmation)
        .content(R.string.delete_category_confirmation)
        .positiveText(R.string.confirm)
        .positiveColorRes(R.color.colorAccent)
        .onPositive((dialog, which) -> {
          // Changes navigation if actually are shown notes associated with this category
          SharedPreferences prefs = getSharedPreferences(PREFS_NAME, MODE_MULTI_PROCESS);
          String navNotes = getResources().getStringArray(R.array.navigation_list_codes)[0];
          String navigation = prefs.getString(PREF_NAVIGATION, navNotes);
          if (String.valueOf(category.getId()).equals(navigation)) {
            prefs.edit().putString(PREF_NAVIGATION, navNotes).apply();
          }
          // Removes category and edit notes associated with it
          DbHelper db = DbHelper.getInstance();
          db.deleteCategory(category);

          EventBus.getDefault().post(new CategoriesUpdatedEvent());
          BaseActivity.notifyAppWidgets(OmniNotes.getAppContext());

          setResult(RESULT_FIRST_USER);
          finish();
        }).build().show();
  }

 

刘贺鑫:今天重新做了新建笔记的fab按钮,点击+号会弹出三个按钮,照片、待办事项、文本。

代码:

<?xml version="1.0" encoding="utf-8"?>

<com.getbase.floatingactionbutton.FloatingActionsMenu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:fab="http://schemas.android.com/apk/res-auto"
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|end"
    fab:fab_addButtonColorNormal="@color/colorAccent"
    fab:fab_addButtonColorPressed="@color/colorAccentPressed"
    fab:fab_addButtonPlusIconColor="@color/white"
    android:layout_marginBottom="8dp"
    android:layout_marginRight="@dimen/fab_right_margin"
    android:layout_marginEnd="@dimen/fab_right_margin"
    android:visibility="invisible"
    fab:fab_labelsPosition="left"
    fab:fab_labelStyle="@style/fab_labels_style">

    <com.getbase.floatingactionbutton.FloatingActionButton
        android:id="@+id/fab_camera"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        fab:fab_icon="@drawable/ic_camera_alt_white_48dp"
        fab:fab_colorNormal="@color/action_color"
        fab:fab_colorPressed="@color/action_color_pressed"
        fab:fab_size="mini"
        fab:fab_title="@string/photo"/>

    <com.getbase.floatingactionbutton.FloatingActionButton
        android:id="@+id/fab_checklist"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        fab:fab_icon="@drawable/ic_format_list_bulleted_white_48dp"
        fab:fab_colorNormal="@color/colorPrimary"
        fab:fab_colorPressed="@color/colorPrimaryDark"
        fab:fab_size="mini"
        fab:fab_title="@string/checklist"/>

    <com.getbase.floatingactionbutton.FloatingActionButton
        android:id="@+id/fab_note"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        fab:fab_icon="@drawable/ic_file_document_box_white_48dp"
        fab:fab_colorNormal="@color/colorAccent"
        fab:fab_colorPressed="@color/colorAccentPressed"
        android:visibility="gone"
        fab:fab_size="mini"
        fab:fab_title="@string/text_note"/>

</com.getbase.floatingactionbutton.FloatingActionsMenu>

 

上一篇:React Native三端同构实践


下一篇:安卓--Navigation的简单使用