Skip to content

Instantly share code, notes, and snippets.

View shivam-gupta007's full-sized avatar
🎯
Focusing

Shivam Gupta shivam-gupta007

🎯
Focusing
View GitHub Profile
@shivam-gupta007
shivam-gupta007 / ConstraintLayoutExample.kt
Created April 7, 2024 13:43
Constraint layout basic example code
@Preview(showBackground = true)
@Composable
fun ConstraintLayoutExample(){
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background
) {
val constraintSet = ConstraintSet {
val greenBox = createRefFor("green_box")
val redBox = createRefFor("red_box")
<activity android:name=".MainActivity" >
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name=" android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
when {
intent?.action == Intent.ACTION_SEND -> {
if ("text/plain" == intent.type) {
handleSendText(intent)
} else if (intent.type?.startsWith("image/") == true) {
handleSendImage(intent)
}
@shivam-gupta007
shivam-gupta007 / second_activity.xml
Created March 8, 2022 13:20
Create an app that find Automorphic, Armstrong, Disarium Number
<?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:padding="15dp"
tools:context=".SecondActivity">
<EditText
@shivam-gupta007
shivam-gupta007 / SecondActivity.java
Created March 8, 2022 13:10
Create an app that find Automorphic, Armstrong, Disarium Number
package com.bca.b1.tca1901074;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
public class SecondActivity extends AppCompatActivity {
@shivam-gupta007
shivam-gupta007 / activity_disarium_no.xml
Created March 7, 2022 16:49
Create an app that find Automorphic, Armstrong, Disarium Number
<?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:padding="15dp"
tools:context=".DisariumNo">
<EditText
@shivam-gupta007
shivam-gupta007 / activity_armstrong_no.xml
Created March 7, 2022 16:48
Create an app that find Automorphic, Armstrong, Disarium Number
<?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:padding="15dp"
tools:context=".ArmstrongNo">
<EditText
@shivam-gupta007
shivam-gupta007 / activity_automorphic_no.xml
Created March 7, 2022 16:47
Create an app that find Automorphic, Armstrong, Disarium Number
<?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:padding="15dp"
tools:context=".AutomorphicNo">
<EditText
@shivam-gupta007
shivam-gupta007 / DisariumNo.java
Created March 7, 2022 16:43
Create an app that find Automorphic, Armstrong, Disarium Number
package com.bca.tca1901074;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
public class DisariumNo extends AppCompatActivity {
@shivam-gupta007
shivam-gupta007 / ArmstrongNo.java
Created March 7, 2022 16:42
Create an app that find Automorphic, Armstrong, Disarium Number
package com.bca.tca1901074;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
public class ArmstrongNo extends AppCompatActivity {