Posts

Showing posts with the label RecyclerView android

RecyclerView using Kotlin

Image
A Simple example to create a RecyclerView using Kotlin Language. build.gradle [under app folder] ============ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { compileSdkVersion 26 defaultConfig { applicationId "com.pratap.kotlinrecyclerview" minSdkVersion 15 targetSdkVersion 26 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" implementation 'com.and

OkHttp 3 Example in Android

Image
Building Simple app using OkHttp Networking Library to get the users data from https://randomuser.me/ API. RecyclerView to show the users data in List, Square Picasso for image Loading. DiagonalLayout for showing image in diagonal shape. Step: 1 ====== Add all Libraries to build.gradle file like below compile ' com . android . support : appcompat - v7: 25.0 . 1 ' compile ' com . squareup . okhttp3 : okhttp: 3.5 . 0 ' compile ' com . squareup . picasso : picasso: 2.5 . 2 ' compile ' com . android . support : recyclerview - v7: 25.0 . 1 ' compile ' com . android . support : cardview - v7: 25.0 . 1 ' compile ' com . android . support : design: 25.0 . 1 ' compile ' com . github . florent37 : diagonallayout: 1.0 . 2 ' compile ' de . hdodenhof : circleimageview: 2.1 . 0 ' Step: 2 ====== Create a model class package com . pratap . okhttpexample . models ; import jav