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
object version { | |
val String.isStable: Boolean | |
get() = !this.isNotStable | |
val String.isNotStable: Boolean | |
get() = listOf("alpha", "beta", "cr", "m", "preview", "b", "ea") | |
.map { label -> Regex("(?i).*[.-]$label[.\\d-+]*") } | |
.any { regex -> regex.matches(this) } | |
} |
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
// | |
// Generate Coverage Reports (Jacoco) Tasks | |
// | |
project.afterEvaluate { | |
/* ktlint-disable max-line-length */ | |
// | |
// Check if project contain Android Application plugin | |
// | |
project.plugins.firstOrNull { plugin -> plugin is AppPlugin } ?: return@afterEvaluate |
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
// | |
// Gradle Versions Plugin | |
// | |
apply(plugin = dep.plugin.versions) | |
tasks.withType<DependencyUpdatesTask>().configureEach { | |
rejectVersionIf { | |
currentVersion.isStable && candidate.version.isNotStable | |
} | |
gradleReleaseChannel = "current" |
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 id.kotlin.situng | |
import org.apache.commons.io.FileUtils | |
import org.openqa.selenium.OutputType | |
import org.openqa.selenium.TakesScreenshot | |
import org.openqa.selenium.chrome.ChromeDriver | |
import java.io.File | |
import java.text.SimpleDateFormat | |
import java.util.Date |
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"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:background="?attr/selectableItemBackground" | |
android:clickable="true" | |
android:padding="8dp"> | |
<ImageView | |
android:id="@+id/iv_home" |
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 HomeFragment extends Fragment { | |
@Override | |
public void onActivityCreated(@Nullable final Bundle savedInstanceState) { | |
super.onActivityCreated(savedInstanceState); | |
// Prepare mock object into list of items | |
final List<String> items = new ArrayList<>(); | |
items.add("Opsi Satu"); | |
items.add("Opsi Dua"); |
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 HomeFragment extends Fragment { | |
@Override | |
public void onActivityCreated(@Nullable final Bundle savedInstanceState) { | |
super.onActivityCreated(savedInstanceState); | |
final RecyclerView recyclerView = (RecyclerView) getActivity().findViewById(R.id.rv_home); | |
final LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext()); | |
final HomeAdapter homeAdapter = new HomeAdapter(items); | |
recyclerView.setLayoutManager(linearLayoutManager); |
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 HomeAdapter extends RecyclerView.Adapter<HomeAdapter.HomeHolder> { | |
private final List<String> mItems; | |
public HomeAdapter(final List<String> items) { | |
mItems = items; | |
} | |
@Override | |
public HomeHolder onCreateViewHolder(final ViewGroup parent, final int viewType) { | |
final View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_home, parent, false); |
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"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<android.support.v7.widget.RecyclerView | |
android:id="@+id/rv_home" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:scrollbars="vertical" /> |
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"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:padding="8dp"> | |
<ImageView | |
android:id="@+id/iv_home" | |
android:layout_width="48dp" | |
android:layout_height="48dp" |
NewerOlder