-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
266 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
app/src/main/java/com/carlos/grabredenvelope/fragment/EmojiFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package com.carlos.grabredenvelope.fragment | ||
|
||
import android.content.Intent | ||
import android.os.Bundle | ||
import android.provider.Settings | ||
import android.view.View | ||
import android.widget.Toast | ||
import androidx.core.widget.doAfterTextChanged | ||
import com.carlos.grabredenvelope.R | ||
import com.carlos.grabredenvelope.data.RedEnvelopePreferences | ||
import kotlinx.android.synthetic.main.fragment_emoji.* | ||
|
||
/** | ||
* _ooOoo_ | ||
* o8888888o | ||
* 88" . "88 | ||
* (| -_- |) | ||
* O\ = /O | ||
* ____/`---'\____ | ||
* .' \\| |// `. | ||
* / \\||| : |||// \ | ||
* / _||||| -:- |||||- \ | ||
* | | \\\ - /// | | | ||
* | \_| ''\---/'' | | | ||
* \ .-\__ `-` ___/-. / | ||
* ___`. .' /--.--\ `. . __ | ||
* ."" '< `.___\_<|>_/___.' >'"". | ||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | | ||
* \ \ `-. \_ __\ /__ _/ .-` / / | ||
* ======`-.____`-.___\_____/___.-`____.-'====== | ||
* `=---=' | ||
* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
* 佛祖保佑 永无BUG | ||
* 佛曰: | ||
* 写字楼里写字间,写字间里程序员; | ||
* 程序人员写程序,又拿程序换酒钱。 | ||
* 酒醒只在网上坐,酒醉还来网下眠; | ||
* 酒醉酒醒日复日,网上网下年复年。 | ||
* 但愿老死电脑间,不愿鞠躬老板前; | ||
* 奔驰宝马贵者趣,公交自行程序员。 | ||
* 别人笑我忒疯癫,我笑自己命太贱; | ||
* 不见满街漂亮妹,哪个归得程序员? | ||
*/ | ||
|
||
/** | ||
* Created by Carlos on 2021/2/8. | ||
*/ | ||
class EmojiFragment : BaseFragment(R.layout.fragment_emoji) { | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
init() | ||
} | ||
|
||
private fun init() { | ||
tv_control.setOnClickListener { | ||
startActivity(Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS)) | ||
Toast.makeText(view?.context, "辅助功能找到(抢微信红包)开启或关闭。", Toast.LENGTH_SHORT) | ||
.show() | ||
} | ||
|
||
et_emoji.setText(RedEnvelopePreferences.autoText) | ||
et_emoji.doAfterTextChanged { | ||
RedEnvelopePreferences.autoText = et_emoji.text.toString() | ||
} | ||
|
||
np_times.minValue = 0 | ||
np_times.maxValue = 100 | ||
np_times.value = RedEnvelopePreferences.emojiTimes | ||
np_times.setOnValueChangedListener { picker, oldVal, newVal -> | ||
RedEnvelopePreferences.emojiTimes = newVal | ||
} | ||
|
||
np_interval.minValue = 0 | ||
np_interval.maxValue = 3000 | ||
np_interval.value = RedEnvelopePreferences.emojiInterval | ||
np_interval.setOnValueChangedListener { picker, oldVal, newVal -> | ||
RedEnvelopePreferences.emojiInterval = newVal | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:orientation="vertical" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
> | ||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical" | ||
android:gravity="center_horizontal"> | ||
|
||
<TextView | ||
android:id="@+id/tv_control" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="5dp" | ||
android:textSize="@dimen/text_size_small" | ||
android:text="自动发表情插件(点击跳转开启)" | ||
android:textColor="@color/blue_light" | ||
android:gravity="center" | ||
/> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="5dp" | ||
android:textSize="@dimen/text_size_small" | ||
android:text="可快速自动发送烟花制造聊天对话页连续放烟花的效果,过年庆祝下,平时也可以快速丢炸弹玩。需先找到辅助功能【自动发送表情】开启才有效" | ||
/> | ||
|
||
<View | ||
android:layout_marginTop="10dp" | ||
android:layout_marginBottom="10dp" | ||
style="@style/view_line"/> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="设置发送文本,如表情[烟花]:"/> | ||
<EditText | ||
android:id="@+id/et_emoji" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
tools:text="[炸弹]" | ||
android:text="[烟花]" | ||
android:singleLine="true" | ||
/> | ||
|
||
<View | ||
android:layout_marginTop="10dp" | ||
android:layout_marginBottom="10dp" | ||
style="@style/view_line"/> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="设置进入一次聊天页自动发送次数(0为无限):"/> | ||
<NumberPicker | ||
android:id="@+id/np_times" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
/> | ||
|
||
<View | ||
android:layout_marginTop="10dp" | ||
android:layout_marginBottom="10dp" | ||
style="@style/view_line"/> | ||
|
||
<TextView | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="设置每次发送间隔时间(ms):"/> | ||
<NumberPicker | ||
android:id="@+id/np_interval" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
/> | ||
|
||
</LinearLayout> | ||
|
||
</ScrollView> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters