├── app ├── .gitignore ├── libs │ └── jsoup-1.10.3.jar ├── src │ ├── main │ │ ├── assets │ │ │ ├── ASC16 │ │ │ ├── HZK16 │ │ │ └── test.lrc │ │ ├── res │ │ │ ├── raw │ │ │ │ └── czt.mp3 │ │ │ ├── mipmap-hdpi │ │ │ │ ├── bcd.jpg │ │ │ │ ├── back.png │ │ │ │ ├── bcd2.jpg │ │ │ │ ├── bubble.png │ │ │ │ ├── compass.png │ │ │ │ ├── ic_launcher.png │ │ │ │ ├── lcd1602bac.jpg │ │ │ │ ├── ic_launcher_round.png │ │ │ │ ├── simple_player_center_pause.png │ │ │ │ └── simple_player_center_play.png │ │ │ ├── values │ │ │ │ ├── styles.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── attrs.xml │ │ │ ├── xml │ │ │ │ └── backup_descriptor.xml │ │ │ ├── layout │ │ │ │ ├── activity_level.xml │ │ │ │ ├── activity_compass.xml │ │ │ │ ├── activity_rotationled.xml │ │ │ │ ├── activity_time.xml │ │ │ │ ├── activity_weather.xml │ │ │ │ ├── listitem.xml │ │ │ │ ├── activity_datetime.xml │ │ │ │ ├── activity_main.xml │ │ │ │ ├── activity_lrc.xml │ │ │ │ ├── activity_sms.xml │ │ │ │ └── activity_lcd1602.xml │ │ │ └── layout-hdpi │ │ │ │ ├── activity_bcd.xml │ │ │ │ ├── activity_7400.xml │ │ │ │ ├── activity_74138.xml │ │ │ │ └── activity_74151.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── supets │ │ │ │ └── pet │ │ │ │ ├── lcd │ │ │ │ ├── ZiMo.java │ │ │ │ ├── RGB.java │ │ │ │ ├── ILCD.java │ │ │ │ ├── LCD1602.java │ │ │ │ ├── ZiMoUtuls.java │ │ │ │ └── LCD1602A.java │ │ │ │ ├── module │ │ │ │ ├── ttl │ │ │ │ │ ├── D74.java │ │ │ │ │ ├── D74151.java │ │ │ │ │ ├── D74138.java │ │ │ │ │ ├── D7400.java │ │ │ │ │ ├── D74Adapter.java │ │ │ │ │ ├── D7400Activity.java │ │ │ │ │ ├── D74107.java │ │ │ │ │ ├── D74151Activity.java │ │ │ │ │ ├── D74Activity.java │ │ │ │ │ └── D74138Activity.java │ │ │ │ ├── led │ │ │ │ │ ├── DateTimeActivity.java │ │ │ │ │ ├── WeatherInfoActivity.java │ │ │ │ │ ├── MainAdapter.java │ │ │ │ │ ├── TimeActivity.java │ │ │ │ │ ├── BusActivity.java │ │ │ │ │ ├── LCD1602Activity.java │ │ │ │ │ └── SmsActivity.java │ │ │ │ ├── sensor │ │ │ │ │ ├── CompassActivity.java │ │ │ │ │ ├── BaseShakeActivity.java │ │ │ │ │ ├── BaseOrientationActivity.java │ │ │ │ │ ├── RotationLedActivity.java │ │ │ │ │ ├── BaseSmsActivity.java │ │ │ │ │ ├── LightActivity.java │ │ │ │ │ └── LevelVialActivity.java │ │ │ │ └── MainActivity.java │ │ │ │ ├── lrc │ │ │ │ ├── LyricContent.java │ │ │ │ ├── MusicBox.java │ │ │ │ ├── LrcRead.java │ │ │ │ └── LrcMainActivity.java │ │ │ │ ├── sensor │ │ │ │ ├── ledPref.java │ │ │ │ ├── BasePref.java │ │ │ │ ├── LevelVialView.java │ │ │ │ └── ShakeEngine.java │ │ │ │ ├── MyApplication.java │ │ │ │ ├── bcd │ │ │ │ ├── GraphicesActivity.java │ │ │ │ ├── BCD.java │ │ │ │ ├── MyView.java │ │ │ │ └── MyView2.java │ │ │ │ ├── bus │ │ │ │ ├── BusInfo.java │ │ │ │ └── BusUtils.java │ │ │ │ ├── view │ │ │ │ ├── WakeScreenUtils.java │ │ │ │ ├── DateLedTextView.java │ │ │ │ ├── ChatUtils.java │ │ │ │ └── LedTextView.java │ │ │ │ ├── weather │ │ │ │ ├── WeatherInfo.java │ │ │ │ └── WeatherApi.java │ │ │ │ ├── sms │ │ │ │ └── SmsRecerver.java │ │ │ │ └── utils │ │ │ │ └── JSonUtil.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── supets │ │ │ └── pet │ │ │ └── ledview │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── supets │ │ └── pet │ │ └── ledview │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── doc ├── 1.png ├── 2.gif ├── czt.mp3 ├── doc.rar ├── 字库+代码.zip └── TestAscii.zip ├── .idea ├── caches │ ├── gradle_models.ser │ └── build_file_checksums.ser ├── encodings.xml ├── vcs.xml ├── compiler.xml ├── modules.xml ├── runConfigurations.xml ├── gradle.xml └── misc.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── README.md ├── gradle.properties ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /doc/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supets-open/LedView/HEAD/doc/1.png -------------------------------------------------------------------------------- /doc/2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supets-open/LedView/HEAD/doc/2.gif -------------------------------------------------------------------------------- /doc/czt.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supets-open/LedView/HEAD/doc/czt.mp3 -------------------------------------------------------------------------------- /doc/doc.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supets-open/LedView/HEAD/doc/doc.rar -------------------------------------------------------------------------------- /doc/字库+代码.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supets-open/LedView/HEAD/doc/字库+代码.zip -------------------------------------------------------------------------------- /doc/TestAscii.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supets-open/LedView/HEAD/doc/TestAscii.zip -------------------------------------------------------------------------------- /app/libs/jsoup-1.10.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supets-open/LedView/HEAD/app/libs/jsoup-1.10.3.jar -------------------------------------------------------------------------------- /app/src/main/assets/ASC16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supets-open/LedView/HEAD/app/src/main/assets/ASC16 -------------------------------------------------------------------------------- /app/src/main/assets/HZK16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supets-open/LedView/HEAD/app/src/main/assets/HZK16 -------------------------------------------------------------------------------- /app/src/main/res/raw/czt.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supets-open/LedView/HEAD/app/src/main/res/raw/czt.mp3 -------------------------------------------------------------------------------- /.idea/caches/gradle_models.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supets-open/LedView/HEAD/.idea/caches/gradle_models.ser -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supets-open/LedView/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/bcd.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supets-open/LedView/HEAD/app/src/main/res/mipmap-hdpi/bcd.jpg -------------------------------------------------------------------------------- /.idea/caches/build_file_checksums.ser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supets-open/LedView/HEAD/.idea/caches/build_file_checksums.ser -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supets-open/LedView/HEAD/app/src/main/res/mipmap-hdpi/back.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/bcd2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supets-open/LedView/HEAD/app/src/main/res/mipmap-hdpi/bcd2.jpg -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/bubble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supets-open/LedView/HEAD/app/src/main/res/mipmap-hdpi/bubble.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/compass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supets-open/LedView/HEAD/app/src/main/res/mipmap-hdpi/compass.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supets-open/LedView/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/lcd1602bac.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supets-open/LedView/HEAD/app/src/main/res/mipmap-hdpi/lcd1602bac.jpg -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supets-open/LedView/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/simple_player_center_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supets-open/LedView/HEAD/app/src/main/res/mipmap-hdpi/simple_player_center_pause.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/simple_player_center_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/supets-open/LedView/HEAD/app/src/main/res/mipmap-hdpi/simple_player_center_play.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LedView 2 | LED点阵屏显示,示例,短消息提示插件 3 | 4 | # 演示 5 | ![](https://github.com/supets-open/LedView/blob/master/doc/1.png) 6 | ![](https://github.com/supets-open/LedView/blob/master/doc/2.gif) 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/lcd/ZiMo.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.lcd; 2 | 3 | public class ZiMo { 4 | public RGB[][] pdata; 5 | 6 | public ZiMo(RGB[][] data) { 7 | this.pdata = data; 8 | } 9 | } -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/xml/backup_descriptor.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #b9bda6 4 | #423e55 5 | #ff0000 6 | 7 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Aug 18 13:24:12 CST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=http://localhost:8082/nexus/content/groups/public/gradle-3.3-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/lcd/RGB.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.lcd; 2 | 3 | public class RGB{ 4 | public int color; 5 | public boolean light; 6 | 7 | public RGB(int color, boolean light) { 8 | this.color = color; 9 | this.light = light; 10 | } 11 | } -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 点阵时钟 3 | 4 | 圆形 5 | 正方形 6 | 长方形 7 | 椭圆形 8 | 三角形 9 | 梯形 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/module/ttl/D74.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.module.ttl; 2 | 3 | public class D74 { 4 | 5 | public int type = 0; 6 | 7 | public String name; 8 | 9 | public String function; 10 | 11 | public D74(int type, String name, String function) { 12 | this.type = type; 13 | this.name = name; 14 | this.function = function; 15 | } 16 | 17 | @Override 18 | public String toString() { 19 | return name+" "+function; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_level.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /app/src/test/java/com/supets/pet/ledview/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.ledview; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_compass.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/lcd/ILCD.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.lcd; 2 | 3 | /** 4 | * LedView 5 | * 6 | * @user lihongjiang 7 | * @description 8 | * @date 2017/8/30 9 | * @updatetime 2017/8/30 10 | */ 11 | 12 | public interface ILCD { 13 | 14 | void closeScreen(); 15 | void openScreen(); 16 | 17 | void moveRam(int leftOrRight); 18 | void clearRam(); 19 | 20 | void writeCGROM(int x,int y,char str ); 21 | void writeDDROM(int x,int y,char str ); 22 | void setDramLength(int length); 23 | void setcgramLength(int length); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/lrc/LyricContent.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.lrc; 2 | 3 | public class LyricContent { 4 | 5 | 6 | private String mLyricContent; 7 | private int mLyricTime; 8 | 9 | public void setLyric(String lyricContent) { 10 | this.mLyricContent = lyricContent; 11 | } 12 | 13 | public String getLyricContent() { 14 | return mLyricContent; 15 | } 16 | 17 | public int getLyricTime() { 18 | return mLyricTime; 19 | } 20 | 21 | public void setLyricTime(int lyricTime) { 22 | this.mLyricTime = lyricTime; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout-hdpi/activity_bcd.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_rotationled.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_time.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_weather.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/listitem.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_datetime.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/sensor/ledPref.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.sensor; 2 | 3 | import android.content.SharedPreferences; 4 | import android.content.SharedPreferences.Editor; 5 | 6 | public class ledPref extends BasePref { 7 | 8 | private static final String Name="weibo_config"; 9 | 10 | private static final String LED_XUANZHUAN="LED_XUANZHUAN"; 11 | 12 | public static int getTime() { 13 | SharedPreferences preferences = getPref(Name); 14 | return preferences.getInt(LED_XUANZHUAN, 10); 15 | } 16 | 17 | public static void saveTime(int time) { 18 | Editor editor = edit(Name); 19 | editor = editor.putInt(LED_XUANZHUAN, time); 20 | editor.commit(); 21 | } 22 | 23 | public static void clear() { 24 | BasePref.clear(Name); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/MyApplication.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet; 2 | 3 | import android.app.Application; 4 | 5 | import com.zhy.http.okhttp.OkHttpUtils; 6 | 7 | import java.util.concurrent.TimeUnit; 8 | 9 | import okhttp3.OkHttpClient; 10 | 11 | public class MyApplication extends Application { 12 | 13 | public static MyApplication instance; 14 | 15 | @Override 16 | public void onCreate() { 17 | super.onCreate(); 18 | 19 | instance=this; 20 | 21 | OkHttpClient okHttpClient = new OkHttpClient.Builder() 22 | .connectTimeout(10000L, TimeUnit.MILLISECONDS) 23 | .readTimeout(10000L, TimeUnit.MILLISECONDS) 24 | .build(); 25 | OkHttpUtils.initClient(okHttpClient); 26 | } 27 | } -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/sensor/BasePref.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.sensor; 2 | 3 | import android.content.Context; 4 | import android.content.SharedPreferences; 5 | import android.text.TextUtils; 6 | 7 | import com.supets.pet.MyApplication; 8 | 9 | class BasePref { 10 | 11 | protected static SharedPreferences getPref(String name) { 12 | if (TextUtils.isEmpty(name)) { 13 | throw new NullPointerException("Shared preferences name is null or empty"); 14 | } 15 | return MyApplication.instance.getSharedPreferences(name, Context.MODE_PRIVATE); 16 | } 17 | 18 | protected static SharedPreferences.Editor edit(String name) { 19 | return getPref(name).edit(); 20 | } 21 | 22 | public static void clear(String name) { 23 | edit(name).clear().commit(); 24 | } 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/module/led/DateTimeActivity.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.module.led; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | 6 | import com.supets.pet.ledview.R; 7 | import com.supets.pet.view.DateLedTextView; 8 | import com.supets.pet.view.WakeScreenUtils; 9 | 10 | public class DateTimeActivity extends Activity { 11 | 12 | 13 | private DateLedTextView date_led; 14 | 15 | @Override 16 | protected void onCreate(Bundle savedInstanceState) { 17 | super.onCreate(savedInstanceState); 18 | WakeScreenUtils.keepScreen(this); 19 | setContentView(R.layout.activity_datetime); 20 | date_led = findViewById(R.id.date_led); 21 | } 22 | 23 | @Override 24 | protected void onDestroy() { 25 | super.onDestroy(); 26 | date_led.stopScroll(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/supets/pet/ledview/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.ledview; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.supets.pet.ledview", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 17 | 18 | 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/module/ttl/D74151.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.module.ttl; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * java实现----------数据选择器功能 8 | */ 9 | public class D74151 { 10 | 11 | private boolean enable = false; 12 | private int channel = 0; 13 | private List output = new ArrayList<>(); 14 | 15 | public void setChannel(int channel) { 16 | this.channel = channel; 17 | } 18 | 19 | public String getResult() { 20 | if (enable) { 21 | if (output != null && (output.size() > channel)) { 22 | return output.get(channel); 23 | } 24 | } 25 | return null; 26 | } 27 | 28 | public void setEnable(boolean enable) { 29 | this.enable = enable; 30 | } 31 | 32 | public void setInputData(int index, String data) { 33 | output.add(index, data); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\studio\Android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/module/ttl/D74138.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.module.ttl; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * java实现----------译码器功能 8 | */ 9 | public class D74138 { 10 | 11 | private boolean enable = false; 12 | private List output = new ArrayList<>(); 13 | 14 | public void setEnable(boolean enable) { 15 | this.enable = enable; 16 | } 17 | 18 | public void setInput(int input) { 19 | if (enable) { 20 | if (output != null 21 | && (output.size() > input) 22 | && output.get(input) != null) { 23 | output.get(input).resultCallBack(input); 24 | } 25 | } 26 | } 27 | 28 | 29 | public void setOutPutResult(int index, OutputResultCallBack listener) { 30 | output.add(index, listener); 31 | } 32 | 33 | public void onDestroy() { 34 | output.clear(); 35 | } 36 | 37 | public interface OutputResultCallBack { 38 | void resultCallBack(int input); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 26 5 | buildToolsVersion "26.0.0" 6 | defaultConfig { 7 | applicationId "com.supets.pet.ledview" 8 | minSdkVersion 16 9 | targetSdkVersion 26 10 | versionCode 1 11 | versionName "1.6" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 25 | exclude group: 'com.android.support', module: 'support-annotations' 26 | }) 27 | compile 'com.android.support:appcompat-v7:26.+' 28 | compile 'com.android.support.constraint:constraint-layout:1.0.2' 29 | 30 | compile 'com.zhy:okhttputils:2.6.2' 31 | compile 'com.google.code.gson:gson:2.8.1' 32 | testCompile 'junit:junit:4.12' 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/bcd/GraphicesActivity.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.bcd; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.os.Handler; 6 | import android.os.Message; 7 | 8 | import com.supets.pet.ledview.R; 9 | 10 | public class GraphicesActivity extends Activity { 11 | 12 | MyView2 lcd1602A; 13 | Handler handler; 14 | 15 | @Override 16 | public void onCreate(Bundle savedInstanceState) { 17 | super.onCreate(savedInstanceState); 18 | setContentView(R.layout.activity_bcd); 19 | 20 | lcd1602A = findViewById(R.id.lcd1602); 21 | 22 | 23 | handler = new Handler(new Handler.Callback() { 24 | @Override 25 | public boolean handleMessage(Message message) { 26 | lcd1602A.updateData(); 27 | handler.sendEmptyMessageDelayed(0, 1000); 28 | return false; 29 | } 30 | }); 31 | handler.sendEmptyMessageDelayed(0, 1000); 32 | } 33 | 34 | @Override 35 | protected void onDestroy() { 36 | super.onDestroy(); 37 | handler.removeMessages(0); 38 | } 39 | 40 | 41 | } -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/bus/BusInfo.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.bus; 2 | 3 | import java.security.PublicKey; 4 | 5 | /** 6 | * LedView 7 | * 8 | * @user lihongjiang 9 | * @description 10 | * @date 2017/8/23 11 | * @updatetime 2017/8/23 12 | */ 13 | 14 | public class BusInfo { 15 | 16 | public String lineNumber; 17 | public String name; 18 | public boolean isStop; 19 | 20 | public BusInfo() { 21 | } 22 | 23 | public String getLineNumber() { 24 | return lineNumber; 25 | } 26 | 27 | public void setLineNumber(String lineNumber) { 28 | this.lineNumber = lineNumber; 29 | } 30 | 31 | public String getName() { 32 | return name; 33 | } 34 | 35 | public void setName(String name) { 36 | this.name = name; 37 | } 38 | 39 | public boolean isStop() { 40 | return isStop; 41 | } 42 | 43 | public void setStop(boolean stop) { 44 | isStop = stop; 45 | } 46 | 47 | public BusInfo(String lineNumber, String name, boolean isStop) { 48 | this.lineNumber = lineNumber; 49 | this.name = name; 50 | this.isStop = isStop; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/view/WakeScreenUtils.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.view; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.os.PowerManager; 6 | import android.provider.SyncStateContract; 7 | import android.view.WindowManager; 8 | 9 | /** 10 | * LedView 11 | * 12 | * @user lihongjiang 13 | * @description 14 | * @date 2017/8/21 15 | * @updatetime 2017/8/21 16 | */ 17 | 18 | public class WakeScreenUtils { 19 | 20 | 21 | private PowerManager.WakeLock wakeLock; 22 | 23 | public void stop() { 24 | if (wakeLock != null) { 25 | wakeLock.release(); 26 | wakeLock = null; 27 | } 28 | } 29 | 30 | //加权限: 31 | public void keep(Context mContext) { 32 | PowerManager pm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); 33 | wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "TAG"); 34 | wakeLock.acquire(); 35 | } 36 | 37 | public static void keepScreen(Activity activity){ 38 | activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/sensor/LevelVialView.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.sensor; 2 | 3 | import android.content.Context; 4 | import android.content.pm.ProviderInfo; 5 | import android.graphics.Bitmap; 6 | import android.graphics.BitmapFactory; 7 | import android.graphics.Canvas; 8 | import android.util.AttributeSet; 9 | import android.view.View; 10 | 11 | import com.supets.pet.ledview.R; 12 | 13 | public class LevelVialView extends View { 14 | // 定义水平仪仪表盘图片 15 | public Bitmap back; 16 | // 定义水平仪中的气泡图标 17 | public Bitmap bubble; 18 | // 定义水平仪中气泡 的X、Y座标 19 | public int bubbleX, bubbleY; 20 | 21 | public LevelVialView(Context context, AttributeSet attrs) { 22 | super(context, attrs); 23 | // 加载水平仪图片和气泡图片 24 | back = BitmapFactory.decodeResource(getResources(), R.mipmap.back); 25 | bubble = BitmapFactory 26 | .decodeResource(getResources(), R.mipmap.bubble); 27 | } 28 | 29 | @Override 30 | protected void onDraw(Canvas canvas) { 31 | super.onDraw(canvas); 32 | // 绘制水平仪表盘图片 33 | canvas.drawBitmap(back, 0, 0, null); 34 | // 根据气泡座标绘制气泡 35 | canvas.drawBitmap(bubble, bubbleX, bubbleY, null); 36 | } 37 | } -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/module/sensor/CompassActivity.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.module.sensor; 2 | 3 | import android.os.Bundle; 4 | import android.util.Log; 5 | import android.view.animation.Animation; 6 | import android.view.animation.RotateAnimation; 7 | import android.widget.ImageView; 8 | 9 | import com.supets.pet.ledview.R; 10 | 11 | public class CompassActivity extends BaseOrientationActivity { 12 | 13 | private ImageView mImageView; 14 | private int predegree = 0; 15 | 16 | @Override 17 | public void onCreate(Bundle savedInstanceState) { 18 | super.onCreate(savedInstanceState); 19 | setContentView(R.layout.activity_compass); 20 | mImageView = findViewById(R.id.imageView); 21 | mImageView.setKeepScreenOn(true);//屏幕高亮 22 | } 23 | 24 | @Override 25 | protected void onOrientationDegree(int degreeX, int degreeY, int degreeZ) { 26 | 27 | RotateAnimation animation = new RotateAnimation(predegree, degreeX, 28 | Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); 29 | animation.setDuration(200); 30 | mImageView.startAnimation(animation); 31 | predegree = -degreeX; 32 | Log.v("角度X:", "" + degreeX); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/module/led/WeatherInfoActivity.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.module.led; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | 6 | import com.supets.pet.ledview.R; 7 | import com.supets.pet.view.LedTextView; 8 | import com.supets.pet.view.WakeScreenUtils; 9 | import com.supets.pet.weather.WeatherApi; 10 | import com.supets.pet.weather.WeatherInfo; 11 | 12 | 13 | public class WeatherInfoActivity extends Activity { 14 | 15 | 16 | private LedTextView time_led; 17 | 18 | @Override 19 | protected void onCreate(Bundle savedInstanceState) { 20 | super.onCreate(savedInstanceState); 21 | WakeScreenUtils.keepScreen(this); 22 | setContentView(R.layout.activity_weather); 23 | 24 | time_led = findViewById(R.id.time_led); 25 | time_led.startScroll(); 26 | time_led.ForceupdateText("获取天气信息中..."); 27 | 28 | WeatherApi.requestWeather("北京", new WeatherApi.WeatherCallBack() { 29 | @Override 30 | public void onSuccess(WeatherInfo info) { 31 | time_led.ForceupdateText(info.toString()); 32 | } 33 | 34 | @Override 35 | public void onFaill() { 36 | time_led.ForceupdateText("-->获取失败!"); 37 | } 38 | }); 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/module/sensor/BaseShakeActivity.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.module.sensor; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.support.annotation.Nullable; 6 | 7 | import com.supets.pet.sensor.ShakeEngine; 8 | 9 | /** 10 | * LedView 11 | * 12 | * @user lihongjiang 13 | * @description 14 | * @date 2017/8/23 15 | * @updatetime 2017/8/23 16 | */ 17 | 18 | public class BaseShakeActivity extends Activity implements ShakeEngine.OnShakeListener { 19 | 20 | private ShakeEngine mShakeEngine; 21 | 22 | @Override 23 | protected void onCreate(@Nullable Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | initShakeEngine(); 26 | } 27 | 28 | private void initShakeEngine() { 29 | mShakeEngine = new ShakeEngine(this); 30 | mShakeEngine.setOnShakeListener(this); 31 | } 32 | 33 | 34 | @Override 35 | protected void onResume() { 36 | super.onResume(); 37 | mShakeEngine.setEnable(true); 38 | mShakeEngine.startSensor(this); 39 | } 40 | 41 | @Override 42 | protected void onPause() { 43 | super.onPause(); 44 | mShakeEngine.setEnable(false); 45 | mShakeEngine.stopSensor(); 46 | } 47 | 48 | @Override 49 | public void onShake() { 50 | 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/module/ttl/D7400.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.module.ttl; 2 | 3 | import android.os.Handler; 4 | 5 | /** 6 | * java实现----------与非门 7 | */ 8 | public class D7400 implements Runnable { 9 | 10 | private Handler handler = new Handler(); 11 | private D7400CallBack mCallBack; 12 | 13 | public D7400(D7400CallBack mCallBack) { 14 | this.mCallBack = mCallBack; 15 | } 16 | 17 | public void seCallBack(D7400CallBack mCallBack) { 18 | this.mCallBack = mCallBack; 19 | } 20 | 21 | private boolean pinA; 22 | private boolean pinB; 23 | 24 | private boolean pinY; 25 | 26 | public void setPinA(boolean pinA) { 27 | this.pinA = pinA; 28 | andnon(); 29 | } 30 | 31 | public void setPinB(boolean pinB) { 32 | this.pinB = pinB; 33 | andnon(); 34 | } 35 | 36 | private void andnon() { 37 | pinY = !(pinA & pinB); 38 | handler.post(this); 39 | } 40 | 41 | @Override 42 | public void run() { 43 | if (mCallBack != null) { 44 | mCallBack.outputY(pinY); 45 | } 46 | } 47 | 48 | public boolean getPinA() { 49 | return pinA; 50 | } 51 | 52 | public boolean getPinB() { 53 | return pinB; 54 | } 55 | 56 | interface D7400CallBack { 57 | void outputY(boolean y); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/module/led/MainAdapter.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.module.led; 2 | 3 | import android.view.LayoutInflater; 4 | import android.view.View; 5 | import android.view.ViewGroup; 6 | import android.widget.BaseAdapter; 7 | import android.widget.TextView; 8 | 9 | import com.supets.pet.ledview.R; 10 | 11 | import java.util.ArrayList; 12 | 13 | public class MainAdapter extends BaseAdapter { 14 | 15 | private ArrayList data = new ArrayList<>(); 16 | 17 | public void setData(ArrayList data) { 18 | if (data != null) { 19 | this.data.addAll(data); 20 | } 21 | } 22 | 23 | @Override 24 | public int getCount() { 25 | return data.size(); 26 | } 27 | 28 | @Override 29 | public Object getItem(int position) { 30 | return data.get(position); 31 | } 32 | 33 | @Override 34 | public long getItemId(int position) { 35 | return position; 36 | } 37 | 38 | @Override 39 | public View getView(int position, View view, ViewGroup viewGroup) { 40 | 41 | if (view == null) { 42 | view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.listitem, viewGroup, false); 43 | } 44 | 45 | TextView name = view.findViewById(R.id.text); 46 | name.setText(position+1+" "+data.get(position)); 47 | return view; 48 | } 49 | } -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/module/ttl/D74Adapter.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.module.ttl; 2 | 3 | import android.view.LayoutInflater; 4 | import android.view.View; 5 | import android.view.ViewGroup; 6 | import android.widget.BaseAdapter; 7 | import android.widget.TextView; 8 | 9 | import com.supets.pet.ledview.R; 10 | 11 | import java.util.ArrayList; 12 | 13 | public class D74Adapter extends BaseAdapter { 14 | 15 | private ArrayList data = new ArrayList<>(); 16 | 17 | public void setData(ArrayList data) { 18 | if (data != null) { 19 | this.data.addAll(data); 20 | } 21 | } 22 | 23 | @Override 24 | public int getCount() { 25 | return data.size(); 26 | } 27 | 28 | @Override 29 | public Object getItem(int position) { 30 | return data.get(position); 31 | } 32 | 33 | @Override 34 | public long getItemId(int position) { 35 | return position; 36 | } 37 | 38 | @Override 39 | public View getView(int position, View view, ViewGroup viewGroup) { 40 | 41 | if (view == null) { 42 | view = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.listitem, viewGroup, false); 43 | } 44 | 45 | TextView name = view.findViewById(R.id.text); 46 | name.setText(position+1+" "+data.get(position).toString()); 47 | return view; 48 | } 49 | } -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/view/DateLedTextView.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.view; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.content.Context; 5 | import android.util.AttributeSet; 6 | 7 | import java.text.SimpleDateFormat; 8 | import java.util.Date; 9 | 10 | public class DateLedTextView extends LedTextView { 11 | 12 | public DateLedTextView(Context context, AttributeSet attrs, int defStyleAttr) { 13 | super(context, attrs, defStyleAttr); 14 | } 15 | 16 | public DateLedTextView(Context context, AttributeSet attrs) { 17 | super(context, attrs); 18 | } 19 | 20 | public DateLedTextView(Context context) { 21 | super(context); 22 | } 23 | 24 | public String changeContent() { 25 | Date currentTime = new Date(); 26 | @SuppressLint("SimpleDateFormat") SimpleDateFormat formatter = 27 | new SimpleDateFormat(" yyyy年MM月dd日 EEEE "); 28 | this.text = formatter.format(currentTime); 29 | if (1 == scrollDirection) { 30 | text = reverseString(text); 31 | } 32 | return text; 33 | } 34 | 35 | @Override 36 | public void onScrollEnd() { 37 | long s = System.currentTimeMillis(); 38 | updateCacheMatrix(ChatUtils.convert(changeContent(), getContext())); 39 | System.out.println("time:" + (System.currentTimeMillis() - s)); 40 | } 41 | } -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/lcd/LCD1602.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.lcd; 2 | 3 | 4 | /** 5 | * LCD1602 字符型显示器( 6 | * 7 | * @user lihongjiang 8 | * @description 2X16个字符,不能显示汉字 9 | * @date 2017/8/30 10 | * @updatetime 2017/8/30 11 | */ 12 | public class LCD1602 implements ILCD { 13 | 14 | private static final int DDRAM_HANG_MAX_BYTE = 40; 15 | private static final int DDRAM_HANG_NUM = 2; 16 | private static final int DDRAM_HANG_BYTE = 16; 17 | private static final int CGRAM_LENGTH = 8;//自定义存储RAM 18 | 19 | private int cursor_postion = 0;//光标位置 20 | 21 | private ZiMo[][] ddram = new ZiMo[DDRAM_HANG_NUM][DDRAM_HANG_MAX_BYTE]; 22 | 23 | private static RGB[][] display = new RGB[DDRAM_HANG_NUM][DDRAM_HANG_MAX_BYTE]; 24 | private static char[] cgram = new char[CGRAM_LENGTH]; 25 | 26 | 27 | @Override 28 | public void closeScreen() { 29 | 30 | } 31 | 32 | @Override 33 | public void openScreen() { 34 | 35 | } 36 | 37 | @Override 38 | public void moveRam(int leftOrRight) { 39 | 40 | } 41 | 42 | @Override 43 | public void clearRam() { 44 | 45 | } 46 | 47 | @Override 48 | public void writeCGROM(int x, int y, char str) { 49 | 50 | } 51 | 52 | @Override 53 | public void writeDDROM(int x, int y, char str) { 54 | 55 | } 56 | 57 | @Override 58 | public void setDramLength(int length) { 59 | 60 | } 61 | 62 | @Override 63 | public void setcgramLength(int length) { 64 | 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/assets/test.lrc: -------------------------------------------------------------------------------- 1 | [ti:我不知道爱是什么] 2 | [ar:艾怡良] 3 | [al:电视剧《16个夏天》插曲] 4 | [by:珍妮] 5 | [00:00.00]我爱歌词网 www.5ilrc.com 6 | [00:00.40]我不知道爱是什么 - 艾怡良 7 | [00:09.49]电视剧《16个夏天》插曲 8 | [00:12.49]词:艾怡良 9 | [00:15.86]曲:金贵晟 10 | [00:18.96] 11 | [00:32.85]坦白来说 12 | [00:35.56]我不知道爱是什么 13 | [00:40.57]爱不爱你 多爱你 14 | [00:47.71]诸如此类的这些话 15 | [00:52.11]我都不知道是什么 16 | [00:55.72]所以不要与我交谈 17 | [00:59.28]不要揣测过头 18 | [01:03.63]如果这些都模糊了 19 | [01:06.81]你的基本认知 20 | [01:11.10]如果对你来说不够隽永 21 | [01:18.08]那么欢迎来到我的脑中 22 | [01:23.38]这里对爱没有解释 23 | [01:26.75]只有一些细微的撩动 24 | [01:32.70] 25 | [01:33.62]例如 我直视你的眼神 26 | [01:37.77]与她不同 27 | [01:41.17]我走过你身边的角度 28 | [01:45.76]与她不同 29 | [01:48.89]我开口跟你说话的时机 30 | [01:53.46]与她不同 31 | [01:56.45]我用的词汇艰涩 32 | [02:01.01]与她不同 33 | [02:04.15] 34 | [02:21.18]坦白来说 35 | [02:24.07]我不知道爱是什么 36 | [02:28.91]爱不爱你 多爱你 37 | [02:36.40]诸如此类的这些话 38 | [02:40.50]我都不知道是什么 39 | [02:44.08]所以不要与我交谈 40 | [02:47.70]不要揣测过头 41 | [02:51.67]如果这些都模糊了 42 | [02:55.25]你的基本认知 43 | [02:59.55]如果对你来说不够隽永 44 | [03:06.46]那么欢迎来到我的脑中 45 | [03:11.74]这里对爱没有解释 46 | [03:14.84]只有一些细微的撩动 47 | [03:20.65] 48 | [03:25.49]例如 我直视你的眼神 49 | [03:30.16]与她不同 50 | [03:33.31]我走过你身边的角度 51 | [03:37.84]与她不同 52 | [03:41.41]我开口跟你说话的时机 53 | [03:45.75]与她不同 54 | [03:49.02]我用的词汇艰涩 55 | [03:53.29]与她不同 56 | [03:56.87]例如 我真的在乎 57 | [04:00.13]否则不会沉默 58 | [04:04.38]一如以往面无表情 59 | [04:08.73]却更汹涌 60 | [04:12.19]还期待或许是坏了规则 61 | [04:16.54]要的太多 62 | [04:20.40]或许爱是这样吧 63 | [04:24.42]那我不懂 64 | [04:27.70] 65 | [04:29.15]我是独一无二的 66 | [04:32.02]你懂不懂 67 | [04:35.80]我的爱是什么 68 | [04:39.04]你得自己感受 69 | [04:45.38]Lrc By:珍妮 QQ:929964514 -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/module/ttl/D7400Activity.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.module.ttl; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.support.annotation.Nullable; 6 | import android.view.View; 7 | import android.widget.TextView; 8 | 9 | import com.supets.pet.ledview.R; 10 | 11 | 12 | public class D7400Activity extends Activity implements D7400.D7400CallBack, View.OnClickListener { 13 | 14 | private TextView result; 15 | private D7400 mSelector = new D7400(this); 16 | 17 | @Override 18 | protected void onCreate(@Nullable Bundle savedInstanceState) { 19 | super.onCreate(savedInstanceState); 20 | setContentView(R.layout.activity_7400); 21 | 22 | result = findViewById(R.id.result); 23 | 24 | findViewById(R.id.btn0).setOnClickListener(this); 25 | findViewById(R.id.btn1).setOnClickListener(this); 26 | findViewById(R.id.btn2).setOnClickListener(this); 27 | findViewById(R.id.btn3).setOnClickListener(this); 28 | 29 | } 30 | 31 | @Override 32 | public void onClick(View view) { 33 | if (view.getId() == R.id.btn0) { 34 | mSelector.setPinA(true); 35 | } else if (view.getId() == R.id.btn1) { 36 | mSelector.setPinA(false); 37 | } else if (view.getId() == R.id.btn2) { 38 | mSelector.setPinB(true); 39 | } else if (view.getId() == R.id.btn3) { 40 | mSelector.setPinB(false); 41 | } 42 | } 43 | 44 | 45 | @Override 46 | public void outputY(boolean y) { 47 | result.setText("A=" + (mSelector.getPinA() ? 1 : 0) 48 | + " B=" + (mSelector.getPinB() ? 1 : 0) 49 | + " Y=" + (y ? 1 : 0)); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/module/ttl/D74107.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.module.ttl; 2 | 3 | import android.os.Handler; 4 | 5 | /** 6 | * java实现----------主从下降沿JK触发器 7 | */ 8 | public class D74107 implements Runnable { 9 | 10 | private int J, K; 11 | private int Q; 12 | private int CLK;//1代表高电平 0-下降沿 13 | private int CLR; 14 | 15 | 16 | //复位 输出永远为0 17 | public void clear() { 18 | CLR = 0; 19 | Q=0; 20 | } 21 | //保持态 Q不确定 22 | public void setNoChange2() { 23 | CLR = 1; 24 | CLK = 1; 25 | } 26 | //保持态,Q不确定 27 | public void setNoChange3() { 28 | CLR = 1; 29 | J = 1; 30 | K = 1; 31 | } 32 | 33 | //稳态 Q=J CLK触发不起作用--Q随J变化,频率不改变 34 | public void setQ() { 35 | CLR = 1; 36 | J = 1; 37 | K = 0; 38 | Q = 1; 39 | } 40 | 41 | //稳态 Q=J CLK触发不起作用--Q随J变化,频率不改变 42 | public void setQ2() { 43 | CLR = 1; 44 | J = 0; 45 | K = 1; 46 | 47 | Q = 0; 48 | } 49 | //触发态 Q=J CLK触发---分频器 50 | public void toggle() { 51 | CLR = 1; 52 | J = 1; 53 | K = 1; 54 | Q = (Q == 1 ? 0 : 1); 55 | } 56 | 57 | 58 | private Handler handler = new Handler(); 59 | private D7400CallBack mCallBack; 60 | 61 | public D74107(D7400CallBack mCallBack) { 62 | this.mCallBack = mCallBack; 63 | } 64 | 65 | public void seCallBack(D7400CallBack mCallBack) { 66 | this.mCallBack = mCallBack; 67 | } 68 | 69 | 70 | @Override 71 | public void run() { 72 | if (mCallBack != null) { 73 | // mCallBack.outputY(Q); 74 | } 75 | } 76 | 77 | interface D7400CallBack { 78 | void outputY(boolean y); 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /app/src/main/java/com/supets/pet/module/led/TimeActivity.java: -------------------------------------------------------------------------------- 1 | package com.supets.pet.module.led; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.os.Handler; 6 | import android.os.Message; 7 | 8 | import com.supets.pet.ledview.R; 9 | import com.supets.pet.view.LedTextView; 10 | import com.supets.pet.view.WakeScreenUtils; 11 | 12 | import java.text.SimpleDateFormat; 13 | import java.util.Date; 14 | 15 | public class TimeActivity extends Activity { 16 | 17 | 18 | private LedTextView time_led; 19 | 20 | private Handler handler; 21 | 22 | @Override 23 | protected void onCreate(Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | WakeScreenUtils.keepScreen(this); 26 | setContentView(R.layout.activity_time); 27 | 28 | time_led = findViewById(R.id.time_led); 29 | time_led.updateText("88:88"); 30 | 31 | handler = new Handler(new Handler.Callback() { 32 | @Override 33 | public boolean handleMessage(Message message) { 34 | time_led.updateText(getStringDate()); 35 | handler.sendEmptyMessageDelayed(0, 1000); 36 | return false; 37 | } 38 | }); 39 | 40 | handler.sendEmptyMessageDelayed(0, 1000); 41 | } 42 | 43 | @Override 44 | protected void onDestroy() { 45 | super.onDestroy(); 46 | handler.removeMessages(0); 47 | } 48 | 49 | private boolean isShan = false; 50 | 51 | public String getStringDate() { 52 | Date currentTime = new Date(); 53 | SimpleDateFormat formatter = new SimpleDateFormat(isShan ? "HH mm" : "HH:mm"); 54 | isShan = !isShan; 55 | String dateString = formatter.format(currentTime); 56 | return dateString; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/res/layout-hdpi/activity_7400.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 15 | 16 | 17 | 29 | 30 | 31 |