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
cd /workspace/$1 | |
VERSION_NAME=$(git describe) | |
VERSION_CODE=$(git rev-list --count master) | |
flutter build apk --build-name=$VERSION_NAME --build-number=$VERSION_CODE |
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
# Flutter (https://flutter.io) Developement Environment for Linux | |
# =============================================================== | |
# | |
# This environment passes all Linux Flutter Doctor checks and is sufficient | |
# for building Android applications and running Flutter tests. | |
# | |
# To build iOS applications, a Mac development environment is necessary. | |
# | |
FROM debian:stretch |
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
public class $objectclass$Adapter extends RecyclerView.Adapter<$objectclass$ViewHolder>{ | |
List<$objectclass$> objList; | |
private Context context; | |
private LayoutInflater inflater; | |
public $objectclass$Adapter(Context context) { | |
this.context = context; | |
inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); | |
} |
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
@Override | |
public synchronized Bitmap getMosaicTile(String hexColor, int tileWidth, int tileHeight) throws Exception { | |
Bitmap newBmp = Bitmap.createBitmap(tileWidth, tileHeight, Bitmap.Config.ARGB_8888); | |
Canvas canvas = new Canvas(newBmp); | |
RectF rectF = new RectF(padding, padding, tileWidth - padding, tileHeight - padding); | |
paint.setColor(Color.parseColor("#" + hexColor)); | |
canvas.drawRoundRect(rectF, radius, radius, paint); | |
return newBmp; | |
} |
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
public class DLRecyclerView extends RecyclerView { | |
public interface OnScrollListener { | |
/** | |
* only works when layoutmanager is LinearLayoutManager | |
*/ | |
public abstract void onScrollToEnd(); | |
} | |
private OnScrollListener _onScrollListener; |
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
abstract public class BaseFragment extends Fragment { | |
/** Constant String representing class name for logs.*/ | |
protected String _tag = ((Object) this).getClass().getSimpleName(); | |
//broadcast manager | |
protected DLBroadcastManager broadcastManager; | |
protected BroadcastReceiver broadcastReceiver; | |
private IntentFilter intentFilter; |
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
/** | |
* Created by damon on 30/1/15. | |
*/ | |
public class GCMReceiver extends WakefulBroadcastReceiver { | |
public static final String TAG = "GCMReceiver"; | |
@Override | |
public void onReceive(Context context, Intent intent) { | |
// Explicitly specify that GCMService will handle the intent. | |
ComponentName comp = new ComponentName(context.getPackageName(), |
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
package com.damon.android; | |
/** | |
* Created by damon on 7/2/15. | |
*/ | |
import android.content.Context; | |
import java.io.Serializable; | |
import java.util.ArrayList; |
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 is just a copy of Android LocalBroadcastManager from SupportLibrary. | |
* | |
* Add sticky broadcast support. PS: not sure it is the best way to do that. | |
* | |
*/ | |
public class StickyLocalBroadcastManager { | |
private static class ReceiverRecord { | |
final IntentFilter filter; |
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
/* | |
* Copyright (C) 2014 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
NewerOlder