Skip to content

Instantly share code, notes, and snippets.

View mbobiosio's full-sized avatar
🎯
Focusing

Mbuodile Obiosio mbobiosio

🎯
Focusing
View GitHub Profile
@mbobiosio
mbobiosio / Fragment New Instance
Last active May 31, 2018 08:51
Fragment NewInstance
//Constructor Class
public AboutFragment() {
}
// New Instance Constructor
public static AboutFragment newInstance() {
AboutFragment fragment = new AboutFragment();
Bundle args = new Bundle();
fragment.setArguments(args);
return fragment;
}
# Optimizations
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-dontwarn org.jaudiotagger.**
-dontwarn java.lang.invoke.*
-dontwarn **$$Lambda$*
-keep class android.support.v4.app.** { *; }
-keep interface android.support.v4.app.** { *; }
private ArrayList<WeekModel> mDataList = new ArrayList<>();
//Implementation in use
private void fetchData() {
mDisposable.add(mWeekService.getLessons()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.map(new Function<WeekResponse, List<WeekModel>>() {
@Override
public List<WeekModel> apply(
public class ApiUtil {
public final static String BASE_URL = "";
private static Retrofit retrofit = null;
public static OkHttpClient getOkHttpClient() {
HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
return new OkHttpClient.Builder()
.addInterceptor(interceptor)
public interface ApiService {
@Headers({"Accept: application/json"})
@POST("/api/v1/mobile/participants")
@FormUrlEncoded
Call<JsonObject> register(@Field("first_name") String firstname,
@Field("last_name") String lastname,
@Field("phone_number") String phone_number,
@Field("project_code") String project_code,
@Field("app_version") String app_version,
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
import android.content.Context;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import java.util.List;
@mbobiosio
mbobiosio / RecyclerViewAdapterTemplate
Created April 3, 2020 11:53
RecyclerViewAdapter live template for Android Studio with androidx imports, ButterKnife and notifyDataSetChanged();
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
[
{
"id": 1,
"category": "Senior",
"count": "230",
"topic": "DAVID'S DESIRE FOR A HOUSE FOR THE LORD",
"verse": "\"Thus saith the LORD, The heaven is my throne, and the earth is my footstool: where is the house that ye build unto me? and where is the place of my rest\” (Isaiah:66:1)",
"text": "2 Samuel:7:1-29, Psalms:30:1, Isaiah:66:1-2",
"content": "http://apostolicfaith.org.uk/index.php?p=curriculum_detail&id=728"
},
@mbobiosio
mbobiosio / teams.json
Created June 11, 2020 10:54
teams.json
[
{
"team_key": "2611",
"team_name": "Leicester",
"team_badge": "https:\/\/apiv2.apifootball.com\/badges\/2611_leicester.png",
"team_country": "England",
"ID": 1
},
{
"team_key": "2612",
[
{
"region": "NG",
"url": "https://www.pick.ng",
"image": "https://i.imgur.com/9tHuldS.jpg",
"type": "web",
"ID": 1
},
{
"region": "NG",