Skip to content

Instantly share code, notes, and snippets.

View biodunalfet's full-sized avatar

Hamza Fetuga biodunalfet

View GitHub Profile
public class Entity {
public boolean isParent;
public boolean isParent() {
return isParent;
}
public void setParent(boolean parent) {
isParent = parent;
this.datas = ToList(peopleAsString);
@biodunalfet
biodunalfet / CardFragment.java
Created December 7, 2016 04:05
1. I added an OnClickListener to the imageview 2. Sent the image to the other activity using a Parceler
package com.example.sep.loveartlearnart;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
@biodunalfet
biodunalfet / AndroidManifest.xml
Created December 7, 2016 04:06
You forgot to add the FullScreenImage to the Manifest Ideally this should be done automatically for you except you manually created the activity
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sep.loveartlearnart">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
@biodunalfet
biodunalfet / FullScreenImage.java
Created December 7, 2016 04:07
I got the ArtModel object sent from the previous activity and displayed it basically
package com.example.sep.loveartlearnart;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;
import android.widget.Toast;
import org.parceler.Parcels;
@biodunalfet
biodunalfet / ArtModel.java
Created December 7, 2016 04:09
I added the @parcel annotation to it to make it Parcelable. I also added an empty constructor. It is required for Parceler to work
package com.example.sep.loveartlearnart;
import org.parceler.Parcel;
/**
* Created by Eni on 2016-12-04.
*/
@Parcel
public class ArtModel {
@biodunalfet
biodunalfet / build.gradle
Created December 7, 2016 04:11
Lines 2, 34 and 35 I added the Parceler library to the project This https://guides.codepath.com/android/Using-Parceler should be helpful in explaining what Parcelables are and why I used the Parceler library.
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 25
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.example.sep.loveartlearnart"
minSdkVersion 15
targetSdkVersion 25
@biodunalfet
biodunalfet / build.gradle
Created December 7, 2016 04:13
Line 9 Necessary for adding the Parceler library
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
// NOTE: Do not place your application dependencies here; they belong
@biodunalfet
biodunalfet / recycle_items.xml
Created December 7, 2016 04:13
Line 30 I added android:clickable = "true"
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
card_view:cardCornerRadius="4dp">
@biodunalfet
biodunalfet / records.js
Created December 5, 2016 20:36
Sample response for records summary endpoint
{
"status": "success",
"data" : [
{
"date" : "2016-12-01",
"total_transaction_count" : 10,
"cash_transaction_count" : 3,
"card_transaction_count" : 7,
"total_amount_made" : 12000.00
},