Skip to content

Instantly share code, notes, and snippets.

💞
NZ

Alfian Yusuf Abdullah alfianyusufabdullah

💞
NZ
Block or report user

Report or block alfianyusufabdullah

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View network.dart
Future<List<Meals>> loadMealsFromNetwork(String category) async {
var result = await httpRequest("$ENDPOINT_FILTER$category");
return generateMealList(result);
}
Future<Meals> loadMealsDetailFromNetwork(String id) async {
var result = await httpRequest("$ENDPOINT_LOCKUP$id");
return generateMeal(result);
}
View app_test.dart
import 'package:flutter_driver/flutter_driver.dart';
import 'package:test/test.dart';
import 'app_test_key.dart';
main() {
group("Application test", () {
FlutterDriver driver;
setUpAll(() async {
View ic_launcher_forebackground.xml
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeWidth="1"
View detail_meals.dart
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();
View Adapter.kt
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])
}
View a.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
View AlarmDetail.java
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;
View FootballDataManager.kt
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()
}
}
View Example.java
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);
View FavoriteWidgetRemoteViewsFactory.java
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;
You can’t perform that action at this time.