Skip to content

Commit

Permalink
Tweak[editor]: reduce timings for the editor to appear
Browse files Browse the repository at this point in the history
  • Loading branch information
Vera-Firefly authored Aug 6, 2023
1 parent d322a2b commit 8cda5d8
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ public EditControlPopup(Context context, ViewGroup parent) {
mColorSelector.getRootView().setTranslationZ(11);
mColorSelector.getRootView().setX(-context.getResources().getDimensionPixelOffset(R.dimen._280sdp));

mEditPopupAnimator = ObjectAnimator.ofFloat(mScrollView, "x", 0).setDuration(1000);
mColorEditorAnimator = ObjectAnimator.ofFloat(mColorSelector.getRootView(), "x", 0).setDuration(1000);
mEditPopupAnimator = ObjectAnimator.ofFloat(mScrollView, "x", 0).setDuration(600);
mColorEditorAnimator = ObjectAnimator.ofFloat(mColorSelector.getRootView(), "x", 0).setDuration(600);
Interpolator decelerate = new AccelerateDecelerateInterpolator();
mEditPopupAnimator.setInterpolator(decelerate);
mColorEditorAnimator.setInterpolator(decelerate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
List<String> renderList = new ArrayList<>(5);
Collections.addAll(renderList, getResources().getStringArray(R.array.renderer));
renderList.add("Default");
mDefaultRenderer.setAdapter(new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, renderList));
mDefaultRenderer.setAdapter(new ArrayAdapter<>(getContext(), R.layout.item_simple_list_1, renderList));

// Set up behaviors
mSaveButton.setOnClickListener(v -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public boolean hasStableIds() {
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
View view = convertView != null?
convertView:
LayoutInflater.from(mContext).inflate(android.R.layout.simple_list_item_1, parent,false);
LayoutInflater.from(mContext).inflate(R.layout.item_simple_list_1, parent,false);

Runtime runtime = mRuntimes.get(position);
if(position == mRuntimes.size() - 1 ){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@

<corners android:radius="@dimen/_2sdp" />

<padding
android:bottom="@dimen/_12sdp"
android:top="@dimen/_11sdp" />

<stroke
android:width="@dimen/_2sdp"
android:color="@color/minebutton_color"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<corners android:radius="@dimen/_2sdp" />

<padding
android:bottom="@dimen/_12sdp"
android:top="@dimen/_11sdp" />
android:bottom="@dimen/padding_input_bottom"
android:top="@dimen/padding_input_top" />

<stroke
android:width="@dimen/_2sdp"
Expand Down
18 changes: 11 additions & 7 deletions app_pojavlauncher/src/main/res/layout/fragment_profile_editor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,11 @@

<Button
android:id="@+id/vprof_editor_version_button"
android:layout_width="@dimen/_72sdp"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:paddingHorizontal="@dimen/padding_large"
android:paddingVertical="0px"


android:text="@string/global_select"

Expand Down Expand Up @@ -99,9 +102,9 @@

<Button
android:id="@+id/vprof_editor_ctrl_button"
android:layout_width="@dimen/_72sdp"
android:layout_width="wrap_content"
android:layout_height="0dp"

android:paddingHorizontal="@dimen/padding_large"
android:text="@string/global_select"


Expand Down Expand Up @@ -161,8 +164,9 @@

<Button
android:id="@+id/vprof_editor_path_button"
android:layout_width="@dimen/_72sdp"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:paddingHorizontal="@dimen/padding_large"
android:text="@string/global_select"

app:layout_constraintBottom_toBottomOf="@id/vprof_editor_path"
Expand All @@ -184,11 +188,11 @@
android:layout_marginTop="32dp"
android:background="@drawable/background_line"
android:paddingVertical="0px"
android:textSize="@dimen/_13ssp"


app:layout_constraintTop_toBottomOf="@+id/vprof_editor_path"

tools:paddingVertical="@dimen/_16sdp" />
tools:paddingVertical="@dimen/_12sdp" />

<ImageView
android:layout_width="wrap_content"
Expand Down Expand Up @@ -221,7 +225,7 @@


app:layout_constraintTop_toBottomOf="@+id/vprof_editor_spinner_runtime"
tools:paddingVertical="@dimen/_16sdp" />
tools:paddingVertical="@dimen/_12sdp" />

<ImageView
android:layout_width="wrap_content"
Expand Down
24 changes: 24 additions & 0 deletions app_pojavlauncher/src/main/res/layout/item_simple_list_1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
A modified version of the simple_list_item_1 android offers
So I could modify it to suit the standard look and feel of the app
-->

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"

android:paddingTop="@dimen/padding_input_top"
android:paddingBottom="@dimen/padding_input_bottom"
android:textAppearance="?android:attr/textAppearanceListItemSmall"


android:textSize="@dimen/_13ssp"
android:gravity="center_vertical"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"

tools:text="PojavLauncher version: Edelweiss"
/>
13 changes: 13 additions & 0 deletions app_pojavlauncher/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
<string name="customctrl_keycombine_shift">Shift</string>
<string name="customctrl_addbutton">添加按键</string>
<string name="customctrl_addbutton_drawer">添加组合键</string>
<string name="customctrl_addbutton_joystick">添加摇杆</string>
<string name="customctrl_addsubbutton">添加子按钮</string>
<string name="customctrl_add_subbutton_message">子按钮 n°%d 已添加!</string>
<string name="customctrl_selectdefault">选择默认 .json 控制键位</string>
Expand Down Expand Up @@ -316,4 +317,16 @@
<string name="mcl_setting_title_buttonallcaps">在按钮标签中仅使用大写字母</string>
<string name="mcl_setting_subtitle_buttonallcaps">如果您想在控件中使用小写字母,请禁用此功能</string>
<string name="create_profile">创建新配置</string>
<string name="customctrl_editor_exit_title">离开?</string>
<string name="customctrl_editor_exit_msg">你真的确定你要离开吗?</string>
<string name="customctrl_editor_exit">离开编辑</string>
<string name="global_save_and_exit">保存并退出</string>
<string name="global_yes">确定</string>
<string name="global_no">取消</string>
<string name="preference_controller_map_wiped">控制器配置已被擦除</string>
<string name="preference_category_controller_settings">控制器设置</string>
<string name="preference_wipe_controller_title">重置控制器映射</string>
<string name="preference_wipe_controller_description">允许您重新映射控制器按钮</string>
<string name="preference_deadzone_scale_title">操纵杆死区比例</string>
<string name="preference_deadzone_scale_description">在操纵杆失灵时增加它</string>
</resources>
4 changes: 4 additions & 0 deletions app_pojavlauncher/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
<dimen name="padding_extra_large">@dimen/_24sdp</dimen>
<dimen name="padding_extra_extra_large">@dimen/_32sdp</dimen>

<!-- Input text padding -->
<dimen name="padding_input_bottom">@dimen/padding_heavy</dimen>
<dimen name="padding_input_top">@dimen/_11sdp</dimen>

<!-- Main Activity components -->
<dimen name="empty_icon_width">60dp</dimen>
<dimen name="empty_icon_height">60dp</dimen>
Expand Down

0 comments on commit 8cda5d8

Please sign in to comment.