Skip to content

Instantly share code, notes, and snippets.

View kyodgorbek's full-sized avatar

Yodgorbek Komilov kyodgorbek

View GitHub Profile
public class IntroductionAdapter extends RecyclerView.Adapter<IntroductionAdapter.MyViewHolder> {
private List<Introduction> introductionList;
Context context; // changes
public IntroductionAdapter(Context context, List<Introduction> introductionList) { // changes
this.context = context; // changes(here you can see context)
this.introductionList = introductionList;
}
@kyodgorbek
kyodgorbek / Education.java
Created October 31, 2018 14:23
Android app
public class Education {
public static final int UNIVERSITY_TYPE=0;
public static final int INTERNET_TYPE = 1;
public static final int SUBJECT_TYPE=2;
public int type;
public int image;
public String words;
public class IntroductionItem extends AppCompatActivity {
public RealmList<Introduction> introductionList;
Context context;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.introduction);
LinearLayout 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"
android:background="@color/colorBlust"
android:orientation="vertical"
android:padding="30dp">
<com.mikhaellopez.circularimageview.CircularImageView
public class DetailActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail);
class CustomAlertDialog(context: Context) : AlertDialog(context, R.style.AppTheme_FullScreenDialogStyle), CustomAlertDialogBuilder.CustomDialogInterface {
var dismissListener: CustomAlertDialogBuilder.OnDismissListener? = null
private var cancelableDialog = true
var alertDialogInfo = CustomAlertDialogBuilder.AlertDialogInfo()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.custom_dialog)
if (cancelableDialog) {
@Override
public void showError(String errorMessage) {
if (errorMessage == null || errorMessage.trim().isEmpty())
errorMessage = getString(R.string.default_error_message);
AlertDialog dialog = new CustomAlertDialogBuilder(this)
.addMessage(errorMessage)
.setPositiveButton("OK", DialogInterface::dismiss)
.build();
try {
if (dialog != null) {
lass StartSessionFragment : BaseMvpFragment(), StartSessionView {
companion object {
const val THERAPY_PACKAGE_ID = "THERAPY_PACKAGE_ID"
}
private var autoPlay: Boolean = true
private var isActivityDestroyed: Boolean = false
private val presenter = StartSessionPresenter(this)
private var activeTherapyPackage: TherapyPackage? = null
private var preSelectedTherapyPackageId: Int? = null
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.empowered.healo.ui.activities.auth.AuthActivity"
tools:showIn="@layout/activity_auth">
@kyodgorbek
kyodgorbek / CustomDialogAlertBuilder
Created January 6, 2019 09:31
CustomDialogAlertBuilder class
class CustomAlertDialogBuilder(val context: Context?) {
private var alertDialogInfo = AlertDialogInfo()
fun addMessage(message: String?): CustomAlertDialogBuilder {
this.alertDialogInfo.message = message
return this
}
fun addMessage(@StringRes message: Int): CustomAlertDialogBuilder {