This file contains hidden or 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
<link rel="import" href="../topeka-elements/theme.html"> | |
<link rel="import" href="../topeka-elements/topeka-resources.html"> | |
<link rel="import" href="../topeka-elements/topeka-app.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; |
This file contains hidden or 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
... | |
<!-- Add permissions --> | |
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> | |
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | |
... | |
<!-- Add receiver detecting wifi connection --> |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/activity_main" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context="me.tomazwang.project.longtextviewwithscroll.MainActivity"> | |
<ScrollView | |
android:layout_width="match_parent" |
This file contains hidden or 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
... | |
import android.databinding.DataBindingUtil; | |
import me.tomazwang.project.databinding.databinding.ActivityMainBinding; | |
... | |
public class MainActivity extends AppCompatActivity { | |
private FunctionInfo funcInfo; |
This file contains hidden or 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
Error:Failed to resolve: com.twitter.sdk.android:twitter:2.2.0 |
This file contains hidden or 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
# Usage: | |
# | |
# 1. screencap and copy to desktop as sc.png | |
# bash ./adb-print.sh | |
# 2. screencap and copy to desktop as <file-name>.png | |
# bash ./adb-print.sh <file-name> | |
# 3. screencap and copy to <path> as <file-name>.png | |
# bash ./adb-print.sh <path> <file-name> | |
adb shell screencap -p /sdcard/sc.png |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:padding="16dp" | |
tools:context="com.linkwish.tsnetworkingsample.MainActivity"> | |
This file contains hidden or 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
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
// 這裡標明了這個 RequestFail annotation 的處理時機 | |
// 這樣說明是否正確? | |
@Retention(RetentionPolicy.RUNTIME) | |
public @interface RequestFail { | |
// - 為什麼這邊可以這樣寫(default的部分) | |
// - 是否只有在創建 annotation 的時候能這樣寫? |
This file contains hidden or 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
public static byte[] decryptDes(byte[] src, byte[] key) throws Exception { | |
SecretKeyFactory factory = SecretKeyFactory.getInstance("DES"); | |
SecretKey secureKey = factory.generateSecret(new DESKeySpec(key)); | |
Cipher cipher = Cipher.getInstance("DES/ECB/PKCS5Padding"); | |
cipher.init(Cipher.DECRYPT_MODE, secureKey); | |
return cipher.doFinal(src); | |
} |
This file contains hidden or 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
// 違反 SRP 的作法 | |
public class MovieRecyclerAdapter extends RecyclerView.Adapter<MovieRecyclerAdapter.ViewHolder> { | |
private List<Movie> movies; | |
private int itemLayout; | |
public MovieRecyclerAdapter(List<Movies> movies, int itemLayout) { | |
this.movies = movies; | |
this.itemLayout = itemLayout; | |
} |
OlderNewer