Skip to content

Instantly share code, notes, and snippets.

@ssindher11
ssindher11 / MainActivity.kt
Last active January 19, 2022 13:23
Movie Booking
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
MovieBookingScreen()
}
}
}
@Preview(showBackground = true)
class MainActivity : AppCompatActivity() {
private var loginID = ""
private lateinit var prefs: SharedPreferences
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
prefs = getSharedPreferences(Constants.PREFS, Context.MODE_PRIVATE)
package com.ssindher.bugfendertut
import android.app.Application
import com.bugfender.android.BuildConfig
import com.bugfender.sdk.Bugfender
class App : Application() {
override fun onCreate() {
super.onCreate()
@ssindher11
ssindher11 / colors.xml
Created January 26, 2020 13:33
Values files for the Chirp Tutorial app
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<color name="colorPrimary">#454545</color>
<color name="colorPrimaryDark">#303030</color>
<color name="colorAccent">#39C79D</color>
<color name="colorPrimaryDarkAlpha">#CC303030</color>
<color name="mtrl_textinput_default_box_stroke_color" tools:override="true">@color/colorAccent</color>
</resources>
@ssindher11
ssindher11 / ReceiveActivity.java
Created January 26, 2020 13:28
Java file for the receive activity of the Chirp Tutorial app
package com.ssindher11.chirptut.activity;
import android.Manifest;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
@ssindher11
ssindher11 / activity_receive.xml
Created January 26, 2020 13:26
Layout file for the receive key activity for the Chirp Tutorial app
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/container_receive_key"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimaryDark"
tools:context=".activity.ReceiveActivity">
@ssindher11
ssindher11 / SendActivity.java
Created January 26, 2020 13:18
Java file for the send key activity for the Chirp Tutorial app
package com.ssindher11.chirptut.activity;
import android.Manifest;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.util.Log;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
@ssindher11
ssindher11 / activity_send.xml
Created January 26, 2020 13:10
Layout file for the send key activity of the Chirp Tutorial app
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/container_send_key"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimaryDark"
tools:context=".activity.SendActivity">
@ssindher11
ssindher11 / activity_main.xml
Created January 26, 2020 13:07
Layout file for the landing page of Chirp Tutorial app
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimaryDark"
tools:context=".activity.MainActivity">
<TextView
@ssindher11
ssindher11 / MainActivity.java
Created January 26, 2020 13:03
Java code for the landing activity for Chirp Tutorial app
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import com.ssindher11.chirptut.R;
public class MainActivity extends AppCompatActivity {
@Override