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
# Naming | |
## 1. File | |
### 1.1. Layout | |
* Activity -> prefix **activity_** | |
* Fragment -> prefix **fragment_** | |
* Custom View -> prefix **view_** | |
* List Item View -> prefix **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
public class ProfilePhotoLayout extends ViewGroup { | |
private ProfilePhoto mProfilePhoto; | |
private Menu mMenu; | |
private Title mTitle; | |
private Subtitle mSubtitle; | |
@Override | |
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { | |
// 1. Setup initial constraints. |
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
int mTextWidth, mTextHeight; // Our calculated text bounds | |
Paint mTextPaint = new Paint(); | |
// Now lets calculate the size of the text | |
Rect textBounds = new Rect(); | |
mTextPaint.getTextBounds(mText, 0, mText.length(), textBounds); | |
mTextWidth = mTextPaint.measureText(mText); // Use measureText to calculate width | |
mTextHeight = textBounds.height(); // Use height from getTextBounds() | |
// Later when you draw... |
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
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |
import android.app.Activity; | |
import android.app.Fragment; | |
import android.app.FragmentManager; | |
#parse("File Header.java") | |
public class ${NAME} extends Fragment { | |
private static final String FRAG_TAG = ${NAME}.class.getCanonicalName(); |
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
using UnityEngine; | |
using System.Collections; | |
using GoogleMobileAds.Api; | |
using System; | |
using GoogleMobileAds; | |
public class AdMob : MonoSingleton<AdMob>, IAd | |
{ | |
[Header("Config ad id")] |
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
using UnityEngine; | |
using System.Collections; | |
public class Logger : MonoSingleton<Logger> | |
{ | |
[SerializeField] | |
private string | |
tag = "Logger"; |
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 void captureView(View view, File outputFile) { | |
//Create a Bitmap with the same dimensions | |
Bitmap image = Bitmap.createBitmap( | |
avatarSize, | |
avatarSize, | |
Bitmap.Config.RGB_565); | |
//Draw the view inside the Bitmap | |
view.draw(new Canvas(image)); | |
//Store to sdcard |
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
/** | |
* Umbala | |
* | |
* Created by Giang Nguyen on 9/26/15. | |
* Copyright (c) 2015 Umbala. All rights reserved. | |
*/ | |
package co.umbala.umbala.ui.widget; | |
import android.animation.Animator; |
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 class DetectViewPagerOverscroll extend OnPageChangeListener { | |
boolean hasSelection; | |
boolean userRelease; | |
private long lastScrollTimeStamp = 0; | |
@Override public void onPageSelected(int position) { | |
//hasSelection = true; | |
radioGroupController.selectItem(position); | |
Timber.d("onPageSelected =====> position: %d", position); | |
} |
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.support.v7.widget.RecyclerView; | |
import android.view.ViewGroup; | |
import java.util.ArrayList; | |
import java.util.List; | |
public abstract class LoadMoreAdapter<T> | |
extends RecyclerView.Adapter<RecyclerView.ViewHolder> { | |
public static final int VIEW_TYPE_LOAD_MORE = 1; |
OlderNewer