Skip to content

Commit

Permalink
change order sample
Browse files Browse the repository at this point in the history
  • Loading branch information
rasoulmiri committed May 9, 2019
1 parent ab8e116 commit 3691da0
Show file tree
Hide file tree
Showing 17 changed files with 112 additions and 107 deletions.
Binary file modified .idea/caches/gradle_models.ser
Binary file not shown.
2 changes: 0 additions & 2 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package io.rmiri.skeleton.master;

import android.content.Context;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewTreeObserver;

import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
Expand All @@ -23,7 +24,6 @@ public abstract class AdapterSkeleton<T,VH extends RecyclerView.ViewHolder> exte
protected IsCanSetAdapterListener isCanSetAdapterListener;
protected SkeletonConfig skeletonConfig = new SkeletonConfig();


protected void measureHeightRecyclerViewAndItem(final RecyclerView recyclerView, final int idLayout) {
ViewTreeObserver viewTreeObserver = recyclerView.getViewTreeObserver();
viewTreeObserver.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
Expand Down
14 changes: 7 additions & 7 deletions sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activity.xml.GradientXmlActivity"/>
<activity android:name=".activity.xml.Fade1XmlActivity"/>
<activity android:name=".activity.xml.FadeXml2Activity"/>
<activity android:name=".activity.xml.ShapeXmlActivity"/>
<activity android:name=".activity.xml.AutoItemsCountXmlActivity"/>
<activity android:name=".activity.java.GradientJavaActivity"/>
<activity android:name=".activity.java.AddViewsByJavaActivity"/>
<activity android:name=".activity.xml.gradientXml.GradientXmlActivity"/>
<activity android:name=".activity.xml.fade1Xml.Fade1XmlActivity"/>
<activity android:name=".activity.xml.fade2Xml.FadeXml2Activity"/>
<activity android:name=".activity.xml.shapeXml.ShapeXmlActivity"/>
<activity android:name=".activity.xml.autoItemsCountXml.AutoItemsCountXmlActivity"/>
<activity android:name=".activity.java.gradientJava.GradientJavaActivity"/>
<activity android:name=".activity.java.addViewsByJava.AddViewsByJavaActivity"/>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
import androidx.appcompat.widget.AppCompatButton;

import io.rmiri.skeleton.sample.R;
import io.rmiri.skeleton.sample.activity.java.AddViewsByJavaActivity;
import io.rmiri.skeleton.sample.activity.java.GradientJavaActivity;
import io.rmiri.skeleton.sample.activity.xml.AutoItemsCountXmlActivity;
import io.rmiri.skeleton.sample.activity.xml.Fade1XmlActivity;
import io.rmiri.skeleton.sample.activity.xml.FadeXml2Activity;
import io.rmiri.skeleton.sample.activity.xml.GradientXmlActivity;
import io.rmiri.skeleton.sample.activity.xml.ShapeXmlActivity;
import io.rmiri.skeleton.sample.activity.java.addViewsByJava.AddViewsByJavaActivity;
import io.rmiri.skeleton.sample.activity.java.gradientJava.GradientJavaActivity;
import io.rmiri.skeleton.sample.activity.xml.autoItemsCountXml.AutoItemsCountXmlActivity;
import io.rmiri.skeleton.sample.activity.xml.fade1Xml.Fade1XmlActivity;
import io.rmiri.skeleton.sample.activity.xml.fade2Xml.FadeXml2Activity;
import io.rmiri.skeleton.sample.activity.xml.gradientXml.GradientXmlActivity;
import io.rmiri.skeleton.sample.activity.xml.shapeXml.ShapeXmlActivity;


public class MainActivity extends AppCompatActivity implements View.OnClickListener {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package io.rmiri.skeleton.sample.activity.java;
package io.rmiri.skeleton.sample.activity.java.addViewsByJava;

import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatImageButton;
import androidx.appcompat.widget.Toolbar;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatImageButton;
import androidx.appcompat.widget.Toolbar;

import java.util.ArrayList;

import io.rmiri.skeleton.SkeletonViewGroup;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
package io.rmiri.skeleton.sample.activity.java;
package io.rmiri.skeleton.sample.activity.java.gradientJava;

import android.os.Bundle;
import android.os.Handler;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.Toolbar;
import android.view.View;

import java.util.ArrayList;

import io.rmiri.skeleton.master.IsCanSetAdapterListener;
import io.rmiri.skeleton.sample.R;
import io.rmiri.skeleton.sample.adapter.java.AdapterGradientJava;
import io.rmiri.skeleton.sample.data.DataObject;
import io.rmiri.skeleton.sample.data.GeneratesDataFake;


public class GradientJavaActivity extends AppCompatActivity {

private RecyclerView recyclerView;
private AdapterGradientJava adapterGradientJava;
private GradientJavaAdapter gradientJavaAdapter;
private ArrayList<DataObject> dataObjects = new ArrayList<>();

@Override
Expand All @@ -43,10 +43,10 @@ public void onClick(View v) {
recyclerView.setHasFixedSize(true);

// Set adapter in recyclerView
adapterGradientJava = new AdapterGradientJava(getApplicationContext(), dataObjects, recyclerView, new IsCanSetAdapterListener() {
gradientJavaAdapter = new GradientJavaAdapter(getApplicationContext(), dataObjects, recyclerView, new IsCanSetAdapterListener() {
@Override
public void isCanSet() {
recyclerView.setAdapter(adapterGradientJava);
recyclerView.setAdapter(gradientJavaAdapter);
}
});

Expand All @@ -56,7 +56,7 @@ public void isCanSet() {
@Override
public void run() {
dataObjects = new GeneratesDataFake().generateDataFake();
adapterGradientJava.addMoreDataAndSkeletonFinish(dataObjects);
gradientJavaAdapter.addMoreDataAndSkeletonFinish(dataObjects);
}
}, 5000);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package io.rmiri.skeleton.sample.adapter.java;
package io.rmiri.skeleton.sample.activity.java.gradientJava;


import android.content.Context;
import androidx.appcompat.widget.AppCompatImageButton;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.cardview.widget.CardView;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.appcompat.widget.AppCompatImageButton;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.cardview.widget.CardView;
import androidx.recyclerview.widget.RecyclerView;

import com.squareup.picasso.Picasso;

import java.util.ArrayList;
Expand All @@ -28,9 +29,9 @@
import static io.rmiri.skeleton.master.SkeletonModel.SHAPE_TYPE_RECT;


public class AdapterGradientJava extends AdapterSkeleton<DataObject, AdapterGradientJava.ViewHolder> {
public class GradientJavaAdapter extends AdapterSkeleton<DataObject, GradientJavaAdapter.ViewHolder> {

public AdapterGradientJava(final Context context, final ArrayList<DataObject> items, final RecyclerView recyclerView, final IsCanSetAdapterListener isCanSetAdapterListener) {
public GradientJavaAdapter(final Context context, final ArrayList<DataObject> items, final RecyclerView recyclerView, final IsCanSetAdapterListener isCanSetAdapterListener) {
this.context = context;
this.items = items;
this.isCanSetAdapterListener = isCanSetAdapterListener;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
package io.rmiri.skeleton.sample.activity.xml;
package io.rmiri.skeleton.sample.activity.xml.autoItemsCountXml;

import android.os.Bundle;
import android.os.Handler;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.Toolbar;
import android.view.View;

import java.util.ArrayList;

import io.rmiri.skeleton.master.IsCanSetAdapterListener;
import io.rmiri.skeleton.sample.adapter.xml.AdapterAutoItemsCountXml;
import io.rmiri.skeleton.sample.R;
import io.rmiri.skeleton.sample.data.DataObject;
import io.rmiri.skeleton.sample.data.GeneratesDataFake;
import io.rmiri.skeleton.sample.R;


public class AutoItemsCountXmlActivity extends AppCompatActivity {

private RecyclerView recyclerView;
private AdapterAutoItemsCountXml adapterAutoItemsCountXml;
private AutoItemsCountXmlAdapter autoItemsCountXmlAdapter;
private ArrayList<DataObject> dataObjects = new ArrayList<>();

@Override
Expand All @@ -42,10 +42,10 @@ public void onClick(View v) {
recyclerView.setLayoutManager(linearLayoutManager);

// Set adapter in recyclerView
adapterAutoItemsCountXml = new AdapterAutoItemsCountXml(getApplicationContext(), dataObjects,recyclerView, new IsCanSetAdapterListener() {
autoItemsCountXmlAdapter = new AutoItemsCountXmlAdapter(getApplicationContext(), dataObjects,recyclerView, new IsCanSetAdapterListener() {
@Override
public void isCanSet() {
recyclerView.setAdapter(adapterAutoItemsCountXml);
recyclerView.setAdapter(autoItemsCountXmlAdapter);
}
});

Expand All @@ -54,7 +54,7 @@ public void isCanSet() {
@Override
public void run() {
dataObjects = new GeneratesDataFake().generateDataFake();
adapterAutoItemsCountXml.addMoreDataAndSkeletonFinish(dataObjects);
autoItemsCountXmlAdapter.addMoreDataAndSkeletonFinish(dataObjects);
}
}, 1000); // After 5 second get data fake

Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
package io.rmiri.skeleton.sample.adapter.xml;
package io.rmiri.skeleton.sample.activity.xml.autoItemsCountXml;


import android.content.Context;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;

import io.rmiri.skeleton.SkeletonViewGroup;
import io.rmiri.skeleton.master.AdapterSkeleton;
import io.rmiri.skeleton.master.IsCanSetAdapterListener;
import io.rmiri.skeleton.SkeletonViewGroup;
import io.rmiri.skeleton.sample.data.DataObject;
import io.rmiri.skeleton.sample.R;
import io.rmiri.skeleton.sample.data.DataObject;


public class AdapterAutoItemsCountXml extends AdapterSkeleton<DataObject, AdapterAutoItemsCountXml.ViewHolder> {
public class AutoItemsCountXmlAdapter extends AdapterSkeleton<DataObject, AutoItemsCountXmlAdapter.ViewHolder> {

public AdapterAutoItemsCountXml(final Context context, final ArrayList<DataObject> items, final RecyclerView recyclerView, final IsCanSetAdapterListener IsCanSetAdapterListener) {
public AutoItemsCountXmlAdapter(final Context context, final ArrayList<DataObject> items, final RecyclerView recyclerView, final IsCanSetAdapterListener IsCanSetAdapterListener) {
this.context = context;
this.items = items;
this.isCanSetAdapterListener = IsCanSetAdapterListener;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
package io.rmiri.skeleton.sample.activity.xml;
package io.rmiri.skeleton.sample.activity.xml.fade1Xml;

import android.os.Bundle;
import android.os.Handler;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.Toolbar;
import android.view.View;

import java.util.ArrayList;

import io.rmiri.skeleton.master.IsCanSetAdapterListener;
import io.rmiri.skeleton.sample.adapter.xml.AdapterFadeXml1;
import io.rmiri.skeleton.sample.R;
import io.rmiri.skeleton.sample.data.DataObject;
import io.rmiri.skeleton.sample.data.GeneratesDataFake;
import io.rmiri.skeleton.sample.R;


public class Fade1XmlActivity extends AppCompatActivity {

private RecyclerView recyclerView;
private AdapterFadeXml1 adapterFadeXml1;
private FadeXml1Adapter fadeXml1Adapter;
private ArrayList<DataObject> dataObjects = new ArrayList<>();

@Override
Expand All @@ -44,10 +44,10 @@ public void onClick(View v) {
recyclerView.setHasFixedSize(true);

// Set adapter in recyclerView
adapterFadeXml1 = new AdapterFadeXml1(getApplicationContext(), dataObjects,recyclerView, new IsCanSetAdapterListener() {
fadeXml1Adapter = new FadeXml1Adapter(getApplicationContext(), dataObjects,recyclerView, new IsCanSetAdapterListener() {
@Override
public void isCanSet() {
recyclerView.setAdapter(adapterFadeXml1);
recyclerView.setAdapter(fadeXml1Adapter);
}
});

Expand All @@ -57,7 +57,7 @@ public void isCanSet() {
@Override
public void run() {
dataObjects = new GeneratesDataFake().generateDataFake();
adapterFadeXml1.addMoreDataAndSkeletonFinish(dataObjects);
fadeXml1Adapter.addMoreDataAndSkeletonFinish(dataObjects);
}
}, 5000);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package io.rmiri.skeleton.sample.adapter.xml;
package io.rmiri.skeleton.sample.activity.xml.fade1Xml;


import android.content.Context;
import androidx.appcompat.widget.AppCompatImageButton;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.cardview.widget.CardView;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.appcompat.widget.AppCompatImageButton;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.cardview.widget.CardView;
import androidx.recyclerview.widget.RecyclerView;

import com.squareup.picasso.Picasso;

import java.util.ArrayList;
Expand All @@ -22,10 +23,10 @@
import io.rmiri.skeleton.sample.data.DataObject;


public class AdapterFadeXml1 extends AdapterSkeleton<DataObject, AdapterFadeXml1.ViewHolder> {
public class FadeXml1Adapter extends AdapterSkeleton<DataObject, FadeXml1Adapter.ViewHolder> {


public AdapterFadeXml1(final Context context, final ArrayList<DataObject> items, final RecyclerView recyclerView, final IsCanSetAdapterListener IsCanSetAdapterListener) {
public FadeXml1Adapter(final Context context, final ArrayList<DataObject> items, final RecyclerView recyclerView, final IsCanSetAdapterListener IsCanSetAdapterListener) {
this.context = context;
this.items = items;
this.isCanSetAdapterListener = IsCanSetAdapterListener;
Expand Down
Loading

0 comments on commit 3691da0

Please sign in to comment.