compact, smalltime: Introduce patches
This commit is contained in:
parent
220d5ded1b
commit
7d47f603a0
4 changed files with 288 additions and 0 deletions
82
patches/compact/835.patch
Normal file
82
patches/compact/835.patch
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
diff -crB -x dist -x build com.discord-835-base/res/layout-v17/widget_chat_list_adapter_item_text.xml com.discord-835/res/layout-v17/widget_chat_list_adapter_item_text.xml
|
||||||
|
*** com.discord-835-base/res/layout-v17/widget_chat_list_adapter_item_text.xml 2019-01-25 10:57:34.419248514 +0300
|
||||||
|
--- com.discord-835/res/layout-v17/widget_chat_list_adapter_item_text.xml 2019-01-28 15:43:17.237442681 +0300
|
||||||
|
***************
|
||||||
|
*** 2,12 ****
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout android:background="?selectableItemBackground" android:paddingTop="10.0dip" android:paddingRight="@dimen/chat_cell_horizontal_spacing_padding" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingEnd="@dimen/chat_cell_horizontal_spacing_padding"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
<androidx.constraintlayout.widget.Guideline android:id="@id/uikit_chat_guideline" style="@style/UiKit.Chat.Guideline" />
|
||||||
|
- <com.facebook.drawee.view.SimpleDraweeView android:id="@id/chat_list_adapter_item_text_avatar" android:layout_marginLeft="8.0dip" android:layout_marginTop="@dimen/uikit_spacing_small" android:importantForAccessibility="no" android:layout_marginStart="8.0dip" app:layout_constrainedWidth="true" app:layout_constraintEnd_toEndOf="@id/uikit_chat_guideline" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toLeftOf="@id/uikit_chat_guideline" app:layout_constraintStart_toStartOf="parent" style="@style/Avatar.Chat" />
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout android:id="@id/chat_list_adapter_item_text_header" android:layout_width="wrap_content" android:layout_height="0.0dip" app:layout_constrainedWidth="true" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintLeft_toRightOf="@id/uikit_chat_guideline" app:layout_constraintRight_toRightOf="parent" app:layout_constraintStart_toEndOf="@id/uikit_chat_guideline" app:layout_constraintTop_toTopOf="@id/chat_list_adapter_item_text_avatar">
|
||||||
|
<TextView android:textColor="?theme_chat_name" android:id="@id/chat_list_adapter_item_text_name" android:lineSpacingMultiplier="1.0" app:layout_constrainedWidth="true" app:layout_constraintBaseline_toBaselineOf="@id/chat_list_adapter_item_text_bot" app:layout_constraintEnd_toStartOf="@id/chat_list_adapter_item_text_bot" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintHorizontal_chainStyle="packed" app:layout_constraintStart_toStartOf="parent" style="@style/UiKit.TextView.Large.SingleLine" />
|
||||||
|
<TextView android:textSize="9.5sp" android:textColor="@color/white" android:id="@id/chat_list_adapter_item_text_bot" android:background="@drawable/drawable_button_purple_neutral" android:paddingLeft="3.0dip" android:paddingTop="0.5dip" android:paddingRight="3.0dip" android:paddingBottom="0.5dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="6.0dip" android:layout_marginBottom="1.0dip" android:text="BOT" android:singleLine="true" android:layout_marginStart="6.0dip" app:layout_constraintEnd_toStartOf="@id/chat_list_adapter_item_text_timestamp" app:layout_constraintStart_toEndOf="@id/chat_list_adapter_item_text_name" style="@style/UiKit.TextView" />
|
||||||
|
<TextView android:textSize="@dimen/uikit_textsize_small" android:textColor="?theme_chat_timestamp" android:gravity="center_vertical" android:id="@id/chat_list_adapter_item_text_timestamp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="6.0dip" android:layout_marginBottom="1.0dip" android:maxWidth="150.0dip" android:singleLine="true" android:layout_marginStart="6.0dip" app:layout_constraintBaseline_toBaselineOf="@id/chat_list_adapter_item_text_name" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@id/chat_list_adapter_item_text_bot" style="@style/UiKit.TextView" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
- <com.discord.utilities.view.text.LinkifiedTextView android:id="@id/chat_list_adapter_item_text" android:layout_width="0.0dip" android:layout_marginTop="@dimen/uikit_spacing_xsmall" android:layout_marginRight="@dimen/uikit_spacing_small" android:layout_marginBottom="2.0dip" android:layout_marginEnd="@dimen/uikit_spacing_small" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintLeft_toRightOf="@id/uikit_chat_guideline" app:layout_constraintRight_toRightOf="parent" app:layout_constraintStart_toEndOf="@id/uikit_chat_guideline" app:layout_constraintTop_toBottomOf="@id/chat_list_adapter_item_text_header" style="@style/UiKit.Chat.Text" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
\ No newline at end of file
|
||||||
|
--- 2,14 ----
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout android:background="?selectableItemBackground" android:paddingTop="10.0dip" android:paddingRight="@dimen/chat_cell_horizontal_spacing_padding" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingEnd="@dimen/chat_cell_horizontal_spacing_padding"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
<androidx.constraintlayout.widget.Guideline android:id="@id/uikit_chat_guideline" style="@style/UiKit.Chat.Guideline" />
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout android:id="@id/chat_list_adapter_item_text_header" android:layout_width="wrap_content" android:layout_height="0.0dip" app:layout_constrainedWidth="true" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintLeft_toRightOf="@id/uikit_chat_guideline" app:layout_constraintRight_toRightOf="parent" app:layout_constraintStart_toEndOf="@id/uikit_chat_guideline" app:layout_constraintTop_toTopOf="@id/chat_list_adapter_item_text_avatar">
|
||||||
|
<TextView android:textColor="?theme_chat_name" android:id="@id/chat_list_adapter_item_text_name" android:lineSpacingMultiplier="1.0" app:layout_constrainedWidth="true" app:layout_constraintBaseline_toBaselineOf="@id/chat_list_adapter_item_text_bot" app:layout_constraintEnd_toStartOf="@id/chat_list_adapter_item_text_bot" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintHorizontal_chainStyle="packed" app:layout_constraintStart_toStartOf="parent" style="@style/UiKit.TextView.Large.SingleLine" />
|
||||||
|
+
|
||||||
|
<TextView android:textSize="9.5sp" android:textColor="@color/white" android:id="@id/chat_list_adapter_item_text_bot" android:background="@drawable/drawable_button_purple_neutral" android:paddingLeft="3.0dip" android:paddingTop="0.5dip" android:paddingRight="3.0dip" android:paddingBottom="0.5dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="6.0dip" android:layout_marginBottom="1.0dip" android:text="BOT" android:singleLine="true" android:layout_marginStart="6.0dip" app:layout_constraintEnd_toStartOf="@id/chat_list_adapter_item_text_timestamp" app:layout_constraintStart_toEndOf="@id/chat_list_adapter_item_text_name" style="@style/UiKit.TextView" />
|
||||||
|
+
|
||||||
|
<TextView android:textSize="@dimen/uikit_textsize_small" android:textColor="?theme_chat_timestamp" android:gravity="center_vertical" android:id="@id/chat_list_adapter_item_text_timestamp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="6.0dip" android:layout_marginBottom="1.0dip" android:maxWidth="150.0dip" android:singleLine="true" android:layout_marginStart="6.0dip" app:layout_constraintBaseline_toBaselineOf="@id/chat_list_adapter_item_text_name" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@id/chat_list_adapter_item_text_bot" style="@style/UiKit.TextView" />
|
||||||
|
+
|
||||||
|
+ <com.discord.utilities.view.text.LinkifiedTextView android:id="@id/chat_list_adapter_item_text" app:layout_constrainedWidth="true" android:layout_marginLeft="6.0dip" android:layout_marginBottom="1.0dip" android:layout_marginStart="6.0dip" app:layout_constraintStart_toEndOf="@id/chat_list_adapter_item_text_timestamp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintLeft_toRightOf="@id/chat_list_adapter_item_text_timestamp" app:layout_constraintRight_toRightOf="parent" style="@style/UiKit.Chat.Text" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
\ No newline at end of file
|
||||||
|
*** com.discord-835-base/res/layout/widget_chat_list_adapter_item_text.xml 2019-01-25 10:57:34.355914908 +0300
|
||||||
|
--- com.discord-835/res/layout/widget_chat_list_adapter_item_text.xml 2019-01-28 15:47:10.325214783 +0300
|
||||||
|
***************
|
||||||
|
*** 2,12 ****
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout android:background="?selectableItemBackground" android:paddingTop="10.0dip" android:paddingRight="@dimen/chat_cell_horizontal_spacing_padding" android:layout_width="fill_parent" android:layout_height="wrap_content"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
<androidx.constraintlayout.widget.Guideline android:id="@id/uikit_chat_guideline" style="@style/UiKit.Chat.Guideline" />
|
||||||
|
- <com.facebook.drawee.view.SimpleDraweeView android:id="@id/chat_list_adapter_item_text_avatar" android:layout_marginLeft="8.0dip" android:layout_marginTop="@dimen/uikit_spacing_small" android:importantForAccessibility="no" app:layout_constrainedWidth="true" app:layout_constraintEnd_toEndOf="@id/uikit_chat_guideline" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toLeftOf="@id/uikit_chat_guideline" app:layout_constraintStart_toStartOf="parent" style="@style/Avatar.Chat" />
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout android:id="@id/chat_list_adapter_item_text_header" android:layout_width="wrap_content" android:layout_height="0.0dip" app:layout_constrainedWidth="true" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintLeft_toRightOf="@id/uikit_chat_guideline" app:layout_constraintRight_toRightOf="parent" app:layout_constraintStart_toEndOf="@id/uikit_chat_guideline" app:layout_constraintTop_toTopOf="@id/chat_list_adapter_item_text_avatar">
|
||||||
|
<TextView android:textColor="?theme_chat_name" android:id="@id/chat_list_adapter_item_text_name" android:lineSpacingMultiplier="1.0" app:layout_constrainedWidth="true" app:layout_constraintBaseline_toBaselineOf="@id/chat_list_adapter_item_text_bot" app:layout_constraintEnd_toStartOf="@id/chat_list_adapter_item_text_bot" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintHorizontal_chainStyle="packed" app:layout_constraintStart_toStartOf="parent" style="@style/UiKit.TextView.Large.SingleLine" />
|
||||||
|
<TextView android:textSize="9.5sp" android:textColor="@color/white" android:id="@id/chat_list_adapter_item_text_bot" android:background="@drawable/drawable_button_purple_neutral" android:paddingLeft="3.0dip" android:paddingTop="0.5dip" android:paddingRight="3.0dip" android:paddingBottom="0.5dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="6.0dip" android:layout_marginBottom="1.0dip" android:text="BOT" android:singleLine="true" app:layout_constraintEnd_toStartOf="@id/chat_list_adapter_item_text_timestamp" app:layout_constraintStart_toEndOf="@id/chat_list_adapter_item_text_name" style="@style/UiKit.TextView" />
|
||||||
|
<TextView android:textSize="@dimen/uikit_textsize_small" android:textColor="?theme_chat_timestamp" android:gravity="center_vertical" android:id="@id/chat_list_adapter_item_text_timestamp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="6.0dip" android:layout_marginBottom="1.0dip" android:maxWidth="150.0dip" android:singleLine="true" app:layout_constraintBaseline_toBaselineOf="@id/chat_list_adapter_item_text_name" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@id/chat_list_adapter_item_text_bot" style="@style/UiKit.TextView" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
- <com.discord.utilities.view.text.LinkifiedTextView android:id="@id/chat_list_adapter_item_text" android:layout_width="0.0dip" android:layout_marginTop="@dimen/uikit_spacing_xsmall" android:layout_marginRight="@dimen/uikit_spacing_small" android:layout_marginBottom="2.0dip" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintLeft_toRightOf="@id/uikit_chat_guideline" app:layout_constraintRight_toRightOf="parent" app:layout_constraintStart_toEndOf="@id/uikit_chat_guideline" app:layout_constraintTop_toBottomOf="@id/chat_list_adapter_item_text_header" style="@style/UiKit.Chat.Text" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
\ No newline at end of file
|
||||||
|
--- 2,11 ----
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout android:background="?selectableItemBackground" android:paddingTop="10.0dip" android:paddingRight="@dimen/chat_cell_horizontal_spacing_padding" android:layout_width="fill_parent" android:layout_height="wrap_content"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
<androidx.constraintlayout.widget.Guideline android:id="@id/uikit_chat_guideline" style="@style/UiKit.Chat.Guideline" />
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout android:id="@id/chat_list_adapter_item_text_header" android:layout_width="wrap_content" android:layout_height="0.0dip" app:layout_constrainedWidth="true" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintLeft_toRightOf="@id/uikit_chat_guideline" app:layout_constraintRight_toRightOf="parent" app:layout_constraintStart_toEndOf="@id/uikit_chat_guideline" app:layout_constraintTop_toTopOf="@id/chat_list_adapter_item_text_avatar">
|
||||||
|
<TextView android:textColor="?theme_chat_name" android:id="@id/chat_list_adapter_item_text_name" android:lineSpacingMultiplier="1.0" app:layout_constrainedWidth="true" app:layout_constraintBaseline_toBaselineOf="@id/chat_list_adapter_item_text_bot" app:layout_constraintEnd_toStartOf="@id/chat_list_adapter_item_text_bot" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintHorizontal_chainStyle="packed" app:layout_constraintStart_toStartOf="parent" style="@style/UiKit.TextView.Large.SingleLine" />
|
||||||
|
<TextView android:textSize="9.5sp" android:textColor="@color/white" android:id="@id/chat_list_adapter_item_text_bot" android:background="@drawable/drawable_button_purple_neutral" android:paddingLeft="3.0dip" android:paddingTop="0.5dip" android:paddingRight="3.0dip" android:paddingBottom="0.5dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="6.0dip" android:layout_marginBottom="1.0dip" android:text="BOT" android:singleLine="true" app:layout_constraintEnd_toStartOf="@id/chat_list_adapter_item_text_timestamp" app:layout_constraintStart_toEndOf="@id/chat_list_adapter_item_text_name" style="@style/UiKit.TextView" />
|
||||||
|
<TextView android:textSize="@dimen/uikit_textsize_small" android:textColor="?theme_chat_timestamp" android:gravity="center_vertical" android:id="@id/chat_list_adapter_item_text_timestamp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="6.0dip" android:layout_marginBottom="1.0dip" android:maxWidth="150.0dip" android:singleLine="true" app:layout_constraintBaseline_toBaselineOf="@id/chat_list_adapter_item_text_name" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@id/chat_list_adapter_item_text_bot" style="@style/UiKit.TextView" />
|
||||||
|
+ <com.discord.utilities.view.text.LinkifiedTextView android:id="@id/chat_list_adapter_item_text" app:layout_constrainedWidth="true" android:layout_marginLeft="6.0dip" android:layout_marginBottom="1.0dip" android:layout_marginStart="6.0dip" app:layout_constraintStart_toEndOf="@id/chat_list_adapter_item_text_timestamp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintLeft_toRightOf="@id/chat_list_adapter_item_text_timestamp" app:layout_constraintRight_toRightOf="parent" style="@style/UiKit.Chat.Text" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
\ No newline at end of file
|
||||||
|
diff -crB -x dist -x build com.discord-835-base/res/values/dimens.xml com.discord-835/res/values/dimens.xml
|
||||||
|
*** com.discord-835-base/res/values/dimens.xml 2019-01-25 10:57:34.429248557 +0300
|
||||||
|
--- com.discord-835/res/values/dimens.xml 2019-01-28 13:48:12.582594416 +0300
|
||||||
|
***************
|
||||||
|
*** 330,337 ****
|
||||||
|
<dimen name="uikit_btn_padding_vertical">4.0dip</dimen>
|
||||||
|
<dimen name="uikit_btn_stroke_width">0.75dip</dimen>
|
||||||
|
<dimen name="uikit_btn_wrapped_min_width">96.0dip</dimen>
|
||||||
|
! <dimen name="uikit_guideline_chat">58.0dip</dimen>
|
||||||
|
! <dimen name="uikit_guideline_chat_embed">62.0dip</dimen>
|
||||||
|
<dimen name="uikit_guideline_item_row">48.0dip</dimen>
|
||||||
|
<dimen name="uikit_guideline_sheet">72.0dip</dimen>
|
||||||
|
<dimen name="uikit_image_border_size">3.0dip</dimen>
|
||||||
|
--- 330,337 ----
|
||||||
|
<dimen name="uikit_btn_padding_vertical">4.0dip</dimen>
|
||||||
|
<dimen name="uikit_btn_stroke_width">0.75dip</dimen>
|
||||||
|
<dimen name="uikit_btn_wrapped_min_width">96.0dip</dimen>
|
||||||
|
! <dimen name="uikit_guideline_chat">20.0dip</dimen>
|
||||||
|
! <dimen name="uikit_guideline_chat_embed">24.0dip</dimen>
|
||||||
|
<dimen name="uikit_guideline_item_row">48.0dip</dimen>
|
||||||
|
<dimen name="uikit_guideline_sheet">72.0dip</dimen>
|
||||||
|
<dimen name="uikit_image_border_size">3.0dip</dimen>
|
9
patches/compact/README.md
Normal file
9
patches/compact/README.md
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
## DisTok CutTheCord: Compact Message Patch
|
||||||
|
|
||||||
|
This patch, when combined with `smalltime` patch, emulates the "compact"/"irc" theme of the discord desktop client.
|
||||||
|
|
||||||
|
![](https://elixi.re/i/nbuosbqc.png)
|
||||||
|
|
||||||
|
#### Available and tested on:
|
||||||
|
- 8.3.5g
|
||||||
|
|
190
patches/smalltime/835.patch
Normal file
190
patches/smalltime/835.patch
Normal file
|
@ -0,0 +1,190 @@
|
||||||
|
diff -crB -x dist -x build com.discord-835-base/smali_classes2/com/miguelgaeta/simple_time/SimpleTime.smali com.discord-835/smali_classes2/com/miguelgaeta/simple_time/SimpleTime.smali
|
||||||
|
*** com.discord-835-base/smali_classes2/com/miguelgaeta/simple_time/SimpleTime.smali 2019-01-25 10:57:34.672582939 +0300
|
||||||
|
--- com.discord-835/smali_classes2/com/miguelgaeta/simple_time/SimpleTime.smali 2019-01-28 15:23:40.845156072 +0300
|
||||||
|
***************
|
||||||
|
*** 247,419 ****
|
||||||
|
.end method
|
||||||
|
|
||||||
|
.method public toReadableTimeString(Ljava/lang/Long;)Ljava/lang/String;
|
||||||
|
! .locals 6
|
||||||
|
!
|
||||||
|
! .line 126
|
||||||
|
! invoke-virtual {p0}, Lcom/miguelgaeta/simple_time/SimpleTime;->currentTimeMillis()J
|
||||||
|
!
|
||||||
|
! move-result-wide v0
|
||||||
|
!
|
||||||
|
! invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||||||
|
!
|
||||||
|
! move-result-object v0
|
||||||
|
!
|
||||||
|
! invoke-virtual {p0, v0}, Lcom/miguelgaeta/simple_time/SimpleTime;->toCalendar(Ljava/lang/Long;)Ljava/util/Calendar;
|
||||||
|
!
|
||||||
|
! move-result-object v0
|
||||||
|
!
|
||||||
|
! const/4 v1, 0x0
|
||||||
|
!
|
||||||
|
! const/16 v2, 0xb
|
||||||
|
!
|
||||||
|
! .line 128
|
||||||
|
! invoke-virtual {v0, v2, v1}, Ljava/util/Calendar;->set(II)V
|
||||||
|
!
|
||||||
|
! const/16 v2, 0xc
|
||||||
|
!
|
||||||
|
! .line 129
|
||||||
|
! invoke-virtual {v0, v2, v1}, Ljava/util/Calendar;->set(II)V
|
||||||
|
!
|
||||||
|
! const/16 v2, 0xd
|
||||||
|
!
|
||||||
|
! .line 130
|
||||||
|
! invoke-virtual {v0, v2, v1}, Ljava/util/Calendar;->set(II)V
|
||||||
|
!
|
||||||
|
! const/16 v2, 0xe
|
||||||
|
!
|
||||||
|
! .line 131
|
||||||
|
! invoke-virtual {v0, v2, v1}, Ljava/util/Calendar;->set(II)V
|
||||||
|
!
|
||||||
|
! .line 133
|
||||||
|
! iget-object v1, p0, Lcom/miguelgaeta/simple_time/SimpleTime;->locale:Ljava/util/Locale;
|
||||||
|
!
|
||||||
|
! invoke-virtual {v1}, Ljava/util/Locale;->getLanguage()Ljava/lang/String;
|
||||||
|
!
|
||||||
|
! move-result-object v1
|
||||||
|
!
|
||||||
|
! const-string v2, "en"
|
||||||
|
!
|
||||||
|
! invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
||||||
|
!
|
||||||
|
! move-result v1
|
||||||
|
!
|
||||||
|
! if-nez v1, :cond_1
|
||||||
|
!
|
||||||
|
! .line 136
|
||||||
|
! invoke-virtual {p1}, Ljava/lang/Long;->longValue()J
|
||||||
|
!
|
||||||
|
! move-result-wide v1
|
||||||
|
!
|
||||||
|
! invoke-virtual {v0}, Ljava/util/Calendar;->getTimeInMillis()J
|
||||||
|
!
|
||||||
|
! move-result-wide v3
|
||||||
|
!
|
||||||
|
! cmp-long v0, v1, v3
|
||||||
|
!
|
||||||
|
! if-lez v0, :cond_0
|
||||||
|
!
|
||||||
|
! .line 137
|
||||||
|
iget-object v0, p0, Lcom/miguelgaeta/simple_time/SimpleTime;->formatterTime:Ljava/text/DateFormat;
|
||||||
|
|
||||||
|
invoke-virtual {v0, p1}, Ljava/text/DateFormat;->format(Ljava/lang/Object;)Ljava/lang/String;
|
||||||
|
|
||||||
|
- move-result-object p1
|
||||||
|
-
|
||||||
|
- return-object p1
|
||||||
|
-
|
||||||
|
- .line 139
|
||||||
|
- :cond_0
|
||||||
|
- iget-object v0, p0, Lcom/miguelgaeta/simple_time/SimpleTime;->formatterDateTime:Ljava/text/DateFormat;
|
||||||
|
-
|
||||||
|
- invoke-virtual {v0, p1}, Ljava/text/DateFormat;->format(Ljava/lang/Object;)Ljava/lang/String;
|
||||||
|
-
|
||||||
|
- move-result-object p1
|
||||||
|
-
|
||||||
|
- return-object p1
|
||||||
|
-
|
||||||
|
- .line 143
|
||||||
|
- :cond_1
|
||||||
|
- invoke-virtual {p1}, Ljava/lang/Long;->longValue()J
|
||||||
|
-
|
||||||
|
- move-result-wide v1
|
||||||
|
-
|
||||||
|
- invoke-virtual {v0}, Ljava/util/Calendar;->getTimeInMillis()J
|
||||||
|
-
|
||||||
|
- move-result-wide v3
|
||||||
|
-
|
||||||
|
- cmp-long v5, v1, v3
|
||||||
|
-
|
||||||
|
- if-lez v5, :cond_2
|
||||||
|
-
|
||||||
|
- .line 144
|
||||||
|
- new-instance v0, Ljava/lang/StringBuilder;
|
||||||
|
-
|
||||||
|
- const-string v1, "Today at "
|
||||||
|
-
|
||||||
|
- invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
||||||
|
-
|
||||||
|
- iget-object v1, p0, Lcom/miguelgaeta/simple_time/SimpleTime;->formatterTime:Ljava/text/DateFormat;
|
||||||
|
-
|
||||||
|
- invoke-virtual {v1, p1}, Ljava/text/DateFormat;->format(Ljava/lang/Object;)Ljava/lang/String;
|
||||||
|
-
|
||||||
|
- move-result-object p1
|
||||||
|
-
|
||||||
|
- invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||||||
|
-
|
||||||
|
- invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
||||||
|
-
|
||||||
|
- move-result-object p1
|
||||||
|
-
|
||||||
|
- return-object p1
|
||||||
|
-
|
||||||
|
- :cond_2
|
||||||
|
- const/4 v1, 0x5
|
||||||
|
-
|
||||||
|
- const/4 v2, -0x1
|
||||||
|
-
|
||||||
|
- .line 147
|
||||||
|
- invoke-virtual {v0, v1, v2}, Ljava/util/Calendar;->add(II)V
|
||||||
|
-
|
||||||
|
- .line 149
|
||||||
|
- invoke-virtual {p1}, Ljava/lang/Long;->longValue()J
|
||||||
|
-
|
||||||
|
- move-result-wide v1
|
||||||
|
-
|
||||||
|
- invoke-virtual {v0}, Ljava/util/Calendar;->getTimeInMillis()J
|
||||||
|
-
|
||||||
|
- move-result-wide v3
|
||||||
|
-
|
||||||
|
- cmp-long v0, v1, v3
|
||||||
|
-
|
||||||
|
- if-lez v0, :cond_3
|
||||||
|
-
|
||||||
|
- .line 150
|
||||||
|
- new-instance v0, Ljava/lang/StringBuilder;
|
||||||
|
-
|
||||||
|
- const-string v1, "Yesterday at "
|
||||||
|
-
|
||||||
|
- invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
||||||
|
-
|
||||||
|
- iget-object v1, p0, Lcom/miguelgaeta/simple_time/SimpleTime;->formatterTime:Ljava/text/DateFormat;
|
||||||
|
-
|
||||||
|
- invoke-virtual {v1, p1}, Ljava/text/DateFormat;->format(Ljava/lang/Object;)Ljava/lang/String;
|
||||||
|
-
|
||||||
|
- move-result-object p1
|
||||||
|
-
|
||||||
|
- invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||||||
|
-
|
||||||
|
- invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
||||||
|
-
|
||||||
|
- move-result-object p1
|
||||||
|
-
|
||||||
|
- return-object p1
|
||||||
|
-
|
||||||
|
- .line 153
|
||||||
|
- :cond_3
|
||||||
|
- iget-object v0, p0, Lcom/miguelgaeta/simple_time/SimpleTime;->formatterDateTime:Ljava/text/DateFormat;
|
||||||
|
-
|
||||||
|
- invoke-virtual {v0, p1}, Ljava/text/DateFormat;->format(Ljava/lang/Object;)Ljava/lang/String;
|
||||||
|
-
|
||||||
|
move-result-object p1
|
||||||
|
|
||||||
|
return-object p1
|
||||||
|
--- 247,257 ----
|
||||||
|
.end method
|
||||||
|
|
||||||
|
.method public toReadableTimeString(Ljava/lang/Long;)Ljava/lang/String;
|
||||||
|
! .locals 1
|
||||||
|
iget-object v0, p0, Lcom/miguelgaeta/simple_time/SimpleTime;->formatterTime:Ljava/text/DateFormat;
|
||||||
|
|
||||||
|
invoke-virtual {v0, p1}, Ljava/text/DateFormat;->format(Ljava/lang/Object;)Ljava/lang/String;
|
||||||
|
|
||||||
|
move-result-object p1
|
||||||
|
|
||||||
|
return-object p1
|
7
patches/smalltime/README.md
Normal file
7
patches/smalltime/README.md
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
## DisTok CutTheCord: Small Time Patch
|
||||||
|
|
||||||
|
This patch replaces the long time string with just a simple time string. This is useful when combined with `compact` patch.
|
||||||
|
|
||||||
|
#### Available and tested on:
|
||||||
|
- 8.3.5g
|
||||||
|
|
Reference in a new issue