Skip to content

Instantly share code, notes, and snippets.

View nuhkoca's full-sized avatar
🇩🇪
In Berlin

Nuh Koca nuhkoca

🇩🇪
In Berlin
View GitHub Profile
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.nuhkoca.android.mvpcleancodedemo"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
public class YoutubeActivity extends YouTubeBaseActivity implements YouTubePlayer.OnInitializedListener, YouTubePlayer.PlayerStateChangeListener, YouTubePlayer.PlaybackEventListener {
private static String VIDEO_ID = "YOUTUBE_VIDEO_ID";
private AlertDialog mAlertDialog;
private RelativeLayout rlYoutube;
private Context mContext = this;
private String getIntentType;
private Context context = this;
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Button
dataBinding {
enabled true
}
public class MainActivity extends AppCompatActivity {
private ActivityMainBinding mActivityMainBinding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mActivityMainBinding = DataBindingUtil.setContentView(this, R.layout.activity_main);
public interface IViewTouchListener {
void onTouched(String text);
}
<?xml version="1.0" encoding="utf-8"?>
<layout>
<data>
<variable
name="touchListener"
type="com.mobilemovement.databindinginterface.callback.IViewTouchListener" />
<variable
name="demoText"
type="String" />
@nuhkoca
nuhkoca / button.xml
Last active December 25, 2017 00:15
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{itemId}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="itemId"
type="Integer" />
</data>
private void init() {
mActivityMainBinding.setVariable(BR.demoText, "Demo Text");
mActivityMainBinding.executePendingBindings();
}