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
// Only a data class. DO NOT ADD BEHAVIORS | |
public class Employee { | |
public Instant dateOfBirth; | |
public BigDecimal salary; | |
public float yearsInService; | |
} |
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 final class MainFragment extends Fragment { | |
public MainFragment() { | |
super(R.layout.fragment_main); | |
} | |
@Override | |
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |
BottomNavigationView navigation = requireViewById(view, R.id.navigation); | |
navigation.setSelectedItemId(R.id.navigation_browse); |
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
package me.devsaki.hentoid; | |
import android.os.Bundle; | |
public final class CoordinateActivityBundle { | |
private static final String KEY_X = "key_x"; | |
private static final String KEY_Y = "key_y"; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<View | |
android:id="@+id/view_main" | |
android:layout_width="0dp" | |
android:layout_height="200dp" |
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
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<View | |
android:id="@+id/view_main" | |
android:layout_width="0dp" | |
android:layout_height="200dp" |
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 RelevantBindListener { | |
public RelevantBindListener() { | |
SampleAdapter adapter = new SampleAdapter(); | |
adapter.setOnLastItemBindListener(this::onAdapterLastItemBind); | |
} | |
private void onAdapterLastItemBind() { | |
// THIS IS CALLED WHEN THE LAST ADAPTER ITEM IS BIND.. BOUND? BINDED?? | |
} |
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 HelloWorldActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
int notificationId = 0; | |
NotificationManager notificationManager = new NotificationManager(this, notificationId); | |
notificationManager.notify(new HelloWorldNotification()); |
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
doTheThing() { | |
var result1 = function1Safe() | |
var result2 = function2Safe() | |
return result1 + result2 | |
} | |
function1Safe() { | |
try { | |
return function1() | |
} catch { |
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
package shiro.am.i.sliderexample; | |
import android.content.Context; | |
import android.support.annotation.LayoutRes; | |
import android.support.annotation.NonNull; | |
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.LinearSnapHelper; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.LayoutInflater; | |
import android.view.View; |
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 DownloadManager implements Closeable { | |
private static final int MAX_TRIES = 3; | |
private final Realm realm = Realm.getDefaultInstance(); | |
@Override | |
public void close() { | |
realm.close(); | |
} |
NewerOlder