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
<!-- Copyright 2019 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 --> | |
<?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" |
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
<!-- Copyright 2019 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 --> | |
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:id="@+id/container" | |
android:orientation="vertical" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" > |
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
<!-- Copyright 2019 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 --> | |
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout 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" | |
android:orientation="vertical" | |
android:layout_width="match_parent" |
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
<!-- Copyright 2019 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 --> | |
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout 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" | |
android:orientation="vertical" | |
android:layout_width="match_parent" |
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
<!-- Copyright 2019 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 --> | |
package com.android.examples.myawesomeapp.ui.home | |
import android.os.Bundle | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import androidx.fragment.app.Fragment |
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
<!-- Copyright 2019 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 --> | |
public class Singleton{ | |
private static Singleton INSTANCE; | |
private Singleton(){} | |
public static Singleton getInstance(){ | |
if (INSTANCE == null){ | |
INSTANCE = new Singleton(); | |
} |
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
<!-- Copyright 2019 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 --> | |
object Singleton { | |
private var count: Int = 0 | |
fun count() { | |
count++ | |
} | |
} |
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
<!-- Copyright 2019 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 --> | |
public final class Singleton { | |
private static int count; | |
public static final Singleton INSTANCE; | |
public final int getCount() {return count;} | |
public final void setCount(int var1) {count = var1;} | |
public final int count() { | |
int var1 = count++; |
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
<!-- Copyright 2019 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 --> | |
val tempValues = object : { | |
var value = 2 | |
var anotherValue = 3 | |
var someOtherValue = 4 | |
} | |
tempValues.value += tempValues.anotherValue |
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
<!-- Copyright 2019 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 --> | |
<undefinedtype> tempValues = new Object() { | |
private int value = 2; | |
private int anotherValue = 3; | |
private int someOtherValue = 4; | |
// getters and setters for x, y, z | |
//... |
OlderNewer