Skip to content

Instantly share code, notes, and snippets.

View alfianyusufabdullah's full-sized avatar
📚
Sometimes playing with Code & Fish

Alfian Yusuf Abdullah alfianyusufabdullah

📚
Sometimes playing with Code & Fish
View GitHub Profile
class MealsDetail extends StatefulWidget {
final String id;
final String category;
final String mealThumbs;
const MealsDetail({Key key, this.id, this.mealThumbs, this.category})
: super(key: key);
@override
_MealsDetailState createState() => _MealsDetailState();
class MainAdapter(private val teams: List<Team>)
: RecyclerView.Adapter<TeamViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TeamViewHolder {
return TeamViewHolder(TeamUI().createView(AnkoContext.create(parent.context, parent)))
}
override fun onBindViewHolder(holder: TeamViewHolder, position: Int) {
holder.bindItem(teams[position])
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
@alfianyusufabdullah
alfianyusufabdullah / AlarmDetail.java
Created January 18, 2019 07:23
Alarm Manager Test
package com.picodiploma.dicoding.alarmtest;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import java.util.Calendar;
class FootballDataManager(private val okHttpClient: OkHttpClient) {
fun loadMatch(match: String) = GlobalScope.async {
val request = Request.Builder().url(match).build()
val response = okHttpClient.newCall(request).execute()
response.body().string()
}
}
package com.dicoding.example;
import android.appwidget.AppWidgetManager;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.ConnectivityManager;
package com.dicoding.example;
import android.appwidget.AppWidgetManager;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.ConnectivityManager;
public class KamusAdapter extends RecyclerView.Adapter<KamusAdapter.KamusHolder>{
private ArrayList<KamusModel> dataKamus;
private Context context;
private LayoutInflater mInflater;
public KamusAdapter(Context context, ArrayList<KamusModel> dataKamus){
this.context = context;
this.dataKamus = dataKamus;
mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
package com.alfianyusufabdullah.infofilm.ui.activity;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.NavigationView;
import android.support.v4.app.Fragment;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar;
package com.alfianyusufabdullah.footballmatchschedule.ui.matchdetail
import android.util.Log
import com.alfianyusufabdullah.footballmatchschedule.BuildConfig
import com.alfianyusufabdullah.footballmatchschedule.database.DatabaseHelper
import com.alfianyusufabdullah.footballmatchschedule.database.database
import com.alfianyusufabdullah.footballmatchschedule.entity.MatchDetail
import com.alfianyusufabdullah.footballmatchschedule.entity.MatchDetailResponse
import com.alfianyusufabdullah.footballmatchschedule.entity.MatchFavorite
import com.alfianyusufabdullah.footballmatchschedule.entity.TeamInfoResponse