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
| interface BTPrinter | |
| { | |
| void printAt(int top, int left, String message); | |
| //add more methods here | |
| void selectFont(String font); | |
| void cutThePaper(); | |
| } | |
| class ZebraPrinter implements BTPrinter |
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
| private int _styleId = SOMEDEFAULTSTYLE; | |
| public void setCustomStyle(int styleId) { | |
| _styleId = styleId; | |
| if(mEditText != null){ | |
| if(styleId == 1) { | |
| mEditText.setTextAppearance(getActivity(), android.R.style.TextAppearance_Small); | |
| } | |
| else if(styleId == 2) { |
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
| apply plugin: 'com.android.application' | |
| def createTheme(colorPrimary, colorPrimaryDark, colorAccent, colorDisabled) { | |
| def returnTheme = new Expando() | |
| returnTheme.colorPrimary = colorPrimary | |
| returnTheme.colorPrimaryDark = colorPrimaryDark | |
| returnTheme.colorAccent = colorAccent | |
| returnTheme.colorDisabled = colorDisabled | |
| return returnTheme | |
| } |
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"?> | |
| <resources> | |
| <!-- Automatically generated file. DO NOT MODIFY --> | |
| <!-- Values from the variant --> | |
| <item name="colorAccent" type="color">#8CC63F</item> | |
| <item name="colorAccentA10" type="color">#198CC63F</item> | |
| <item name="colorAccentA20" type="color">#338CC63F</item> | |
| <item name="colorAccentA30" type="color">#4c8CC63F</item> |
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"?> | |
| <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
| <item | |
| android:bottom="-6dp" | |
| android:right="-6dp" | |
| android:top="-6dp"> | |
| <shape> | |
| <solid android:color="@android:color/black" /> | |
| <stroke | |
| android:width="5dp" |
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
| //use this builder instead NotificationCompat.BigPictureStyle (also use standard Notification not compat) | |
| static class MyPictureBuilder extends Notification.BigPictureStyle{ | |
| @NonNull | |
| @Override | |
| protected RemoteViews getStandardView(int layoutId) { | |
| RemoteViews ret = super.getStandardView(layoutId); | |
| int id = Resources.getSystem().getIdentifier("text", "id", "android"); | |
| ret.setBoolean(id, "setSingleLine", false); | |
| ret.setInt(id, "setLines", 4); |
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
| package pl.selvin.android.broadcastkilled; | |
| import android.app.Activity; | |
| import android.app.Notification; | |
| import android.content.BroadcastReceiver; | |
| import android.content.Context; | |
| import android.content.Intent; | |
| import android.content.IntentFilter; | |
| import android.os.Bundle; | |
| import android.util.Log; |
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
| package pl.selvin.android.xxxxxx; | |
| import android.graphics.Bitmap; | |
| import android.graphics.BitmapFactory; | |
| /** | |
| * Created by selvin on 2015-01-28. | |
| */ | |
| public class WebPUtils { | |
| //states |
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.app.Activity; | |
| import android.content.Context; | |
| import android.content.Intent; | |
| import android.net.Uri; | |
| import android.os.Bundle; | |
| public class TestActivity extends Activity { | |
| //well context is not valid yet, but we will use later so it is ok to use "this" | |
| private Helper helper = new Helper(this); |
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
| interface IMySuperInterface { | |
| void setNumPlats(int numero); | |
| } | |
| class MyAtivity extends Activity implements IMySuperInterface { | |
| //do the implentation and other stuff; | |
| } | |
| class MyFragment extends Fragment { | |
| IMySuperInterface defaultInstance = new IMySuperInterface { |
OlderNewer