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 MainActivity | |
extends RealmActivity { | |
Post post; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
ActivityMainBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_main); | |
post = realm.where(Post.class).equalTo("id", 1L).findFirst(); |
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
private ConnectivityChangeReceiver mConnectivityChangeReceiver; | |
@Override | |
protected void onResume() { | |
super.onResume(); | |
mConnectivityChangeReceiver = new ConnectivityChangeReceiver(); | |
registerReceiver(mConnectivityChangeReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION)); | |
} | |
@Override |
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
@Parcel(implementations = { CountryRealmProxy.class }, | |
value = Parcel.Serialization.FIELD, | |
analyze = { Country.class }) | |
public class Country extends RealmObject { | |
@ParcelPropertyConverter(RealmListParcelConverter.class) | |
public RealmList<RealmString> languages; | |
} | |
public class RealmListParcelConverter | |
implements TypeRangeParcelConverter<RealmList<? extends RealmObject>, |
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
import android.graphics.Color; | |
import android.os.Bundle; | |
import android.support.v4.widget.SwipeRefreshLayout; | |
import android.support.v7.widget.DefaultItemAnimator; | |
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import com.togethernetworks.basesdk.BaseActivity; | |
import com.togethernetworks.gallery.samples.mortar.UiModule; |
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
import android.graphics.Bitmap; | |
import android.graphics.BitmapShader; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import com.squareup.picasso.Transformation; | |
public class CircleTransform implements Transformation { | |
private final int BORDER_COLOR = Color.WHITE; |
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
import android.content.Context; | |
import android.graphics.drawable.Drawable; | |
import android.os.Parcel; | |
import android.os.Parcelable; | |
import android.util.AttributeSet; | |
import android.view.MotionEvent; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.Checkable; | |
import android.widget.LinearLayout; |
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
For Android: | |
Manually change it in android/app/src/main/java/com/PROJECT_NAME/MainActivity.java: | |
package MY.APP.ID; | |
In android/app/src/main/java/com/PROJECT_NAME/MainApplication.java: | |
package MY.APP.ID; | |
In android/app/src/main/AndroidManifest.xml: | |
package="MY.APP.ID" |
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
/** | |
* SimpleRVAdapter to quickly get started with simple Lists in Recyclerview | |
* | |
* Usage: | |
* | |
* RecyclerView rv = (RecyclerView)findViewById(R.id.rv); | |
* rv.setLayoutManager(new LinearLayoutManager(getContext())); | |
* rv.setAdapter(new SimpleRVAdapter(new String[] {"1", "2", "3", "4", "5", "6", "7"})); | |
* | |
* @author Sheharyar Naseer |
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 hook overrides a function check at runtime. Currently, cordova-android 7+ incorrectly detects that we are using | |
* an eclipse style project. This causes a lot of plugins to fail at install time due to paths actually being setup | |
* for an Android Studio project. Some plugins choose to install things into 'platforms/android/libs' which makes | |
* this original function assume it is an ecplise project. | |
*/ | |
module.exports = function(context) { | |
if (context.opts.cordova.platforms.indexOf('android') < 0) { | |
return; | |
} |
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
# Workflow from https://github.com/necolas/dotfiles | |
# Add the new submodule | |
git submodule add git://example.com/remote/path/to/repo.git vim/bundle/one-submodule | |
# Initialize the submodule | |
git submodule init | |
# Clone the submodule | |
git submodule update | |
# Stage the changes | |
git add vim/bundle/one-submodule |
OlderNewer