-
Notifications
You must be signed in to change notification settings - Fork 0
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
155 changed files
with
965 additions
and
618 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
23 changes: 23 additions & 0 deletions
23
DroidUtils/src/main/java/io/github/longluo/util/ClickDelayUtils.java
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,23 @@ | ||
package io.github.longluo.util; | ||
|
||
public class ClickDelayUtils { | ||
|
||
private static final int MIN_CLICK_DELAY_TIME = 1000; | ||
|
||
private static long lastClickTime; | ||
|
||
public static boolean isFastClick() { | ||
boolean flag = false; | ||
|
||
long curClickTime = System.currentTimeMillis(); | ||
|
||
if ((curClickTime - lastClickTime) >= MIN_CLICK_DELAY_TIME) { | ||
flag = true; | ||
} | ||
|
||
lastClickTime = curClickTime; | ||
|
||
return flag; | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
DroidUtils/src/main/java/io/github/longluo/util/helpers/OnClickEvent.java
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,34 @@ | ||
package io.github.longluo.util.helpers; | ||
|
||
import android.view.View; | ||
|
||
public abstract class OnClickEvent implements View.OnClickListener { | ||
|
||
private static long lastTime; | ||
|
||
public abstract void singleClick(View v); | ||
|
||
private long delay; | ||
|
||
public OnClickEvent(long delay) { | ||
this.delay = delay; | ||
} | ||
|
||
@Override | ||
public void onClick(View v) { | ||
if (onMoreClick(v)) { | ||
return; | ||
} | ||
singleClick(v); | ||
} | ||
|
||
public boolean onMoreClick(View v) { | ||
boolean flag = false; | ||
long time = System.currentTimeMillis() - lastTime; | ||
if (time < delay) { | ||
flag = true; | ||
} | ||
lastTime = System.currentTimeMillis(); | ||
return flag; | ||
} | ||
} |
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
25 changes: 0 additions & 25 deletions
25
app/src/androidTest/java/com/longluo/android/ExampleInstrumentedTest.java
This file was deleted.
Oops, something went wrong.
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
2 changes: 1 addition & 1 deletion
2
...om/longluo/android/dao/gen/DaoMaster.java → ...va/com/longluo/android/dao/DaoMaster.java
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
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
2 changes: 1 addition & 1 deletion
2
...ongluo/android/action/TitleBarAction.java → ...ongluo/android/action/TitleBarAction.java
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
2 changes: 1 addition & 1 deletion
2
...m/longluo/android/action/ToastAction.java → ...e/longluo/android/action/ToastAction.java
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.longluo.android.action; | ||
package me.longluo.android.action; | ||
|
||
import androidx.annotation.StringRes; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...ava/com/longluo/android/aop/CheckNet.java → ...java/me/longluo/android/aop/CheckNet.java
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
2 changes: 1 addition & 1 deletion
2
...ain/java/com/longluo/android/aop/Log.java → ...main/java/me/longluo/android/aop/Log.java
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
2 changes: 1 addition & 1 deletion
2
.../com/longluo/android/aop/Permissions.java → ...a/me/longluo/android/aop/Permissions.java
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
2 changes: 1 addition & 1 deletion
2
.../com/longluo/android/aop/SingleClick.java → ...a/me/longluo/android/aop/SingleClick.java
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
2 changes: 1 addition & 1 deletion
2
...a/com/longluo/android/app/AppAdapter.java → ...va/me/longluo/android/app/AppAdapter.java
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
Oops, something went wrong.