├── .gitignore
├── DynamicBox
├── .gitignore
├── build.gradle
├── gradle.properties
└── src
│ └── main
│ ├── .settings
│ └── org.eclipse.jdt.core.prefs
│ ├── AndroidManifest.xml
│ ├── java
│ └── mehdi
│ │ └── sakout
│ │ └── dynamicbox
│ │ └── DynamicBox.java
│ └── res
│ ├── layout
│ ├── exception_failure.xml
│ ├── exception_loading_content.xml
│ └── exception_no_internet.xml
│ └── values
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
├── DynamicBoxExample
├── .gitignore
├── build.gradle
├── gradle.properties
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── mehdi
│ │ └── sakout
│ │ └── dynamicboxexample
│ │ ├── ActivityActivity.java
│ │ ├── ListViewActivity.java
│ │ └── MainActivity.java
│ └── res
│ ├── drawable-hdpi
│ ├── green_monster.png
│ ├── ic_launcher.png
│ ├── nature.jpg
│ └── saxophone.png
│ ├── drawable-mdpi
│ └── ic_launcher.png
│ ├── drawable-xhdpi
│ └── ic_launcher.png
│ ├── drawable-xxhdpi
│ └── ic_launcher.png
│ ├── layout
│ ├── activity_activity.xml
│ ├── activity_listview.xml
│ ├── activity_main.xml
│ └── music_not_found.xml
│ ├── values-w820dp
│ └── dimens.xml
│ └── values
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── README.md
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── maven_push.gradle
├── screenshots
├── 1.png
├── 2.png
├── 3.png
├── 4.png
├── 5.png
├── apps
│ └── com.mobiacube.elbotola.png
├── cat-box-icon.png
├── demo_gmail_no_messages.png
├── demo_gplay_no_internet.png
├── demo_popcorn_loading.png
└── demo_slack_loading.png
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | #built application files
2 | *.apk
3 | *.ap_
4 |
5 | # files for the dex VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 |
11 | # generated files
12 | bin/
13 | gen/
14 |
15 | # Local configuration file (sdk path, etc)
16 | local.properties
17 |
18 | # Windows thumbnail db
19 | Thumbs.db
20 |
21 | # OSX files
22 | .DS_Store
23 |
24 | # Eclipse project files
25 | .classpath
26 | .project
27 |
28 | # Android Studio
29 | .idea
30 | .gradle
31 | build/
32 |
33 | project.properties
34 | out
35 | *.iml
--------------------------------------------------------------------------------
/DynamicBox/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/DynamicBox/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'android-library'
2 |
3 | repositories {
4 | mavenCentral()
5 | }
6 |
7 | android {
8 | compileSdkVersion 22
9 | buildToolsVersion "22.0.1"
10 |
11 | defaultConfig {
12 | minSdkVersion 8
13 | targetSdkVersion 22
14 | versionCode 2
15 | versionName "1.2"
16 | }
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | compile fileTree(dir: 'libs', include: ['*.jar'])
27 | }
28 |
29 | apply from: '../maven_push.gradle'
--------------------------------------------------------------------------------
/DynamicBox/gradle.properties:
--------------------------------------------------------------------------------
1 | VERSION_NAME=1.2
2 | VERSION_CODE=4
3 | GROUP=com.github.medyo
4 | POM_DESCRIPTION=Dynamicbox lib
5 | POM_URL=https://github.com/medyo/dynamicbox
6 | POM_SCM_URL=https://github.com/medyo/dynamicbox
7 | POM_SCM_CONNECTION=scm:git@github.com:medyo/dynamicbox.git
8 | POM_SCM_DEV_CONNECTION=scm:git@github.com:medyo/dynamicbox.git
9 | POM_LICENCE_NAME=MIT
10 | POM_LICENCE_URL=http://opensource.org/licenses/MIT
11 | POM_LICENCE_DIST=repo
12 | POM_DEVELOPER_ID=medyo
13 | POM_DEVELOPER_NAME=Mehdi Sakout
14 |
15 | POM_NAME=Dynamicbox Library
16 | POM_ARTIFACT_ID=dynamicbox
17 | POM_PACKAGING=aar
--------------------------------------------------------------------------------
/DynamicBox/src/main/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
3 | org.eclipse.jdt.core.compiler.compliance=1.6
4 | org.eclipse.jdt.core.compiler.source=1.6
5 |
--------------------------------------------------------------------------------
/DynamicBox/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
9 |
10 |
--------------------------------------------------------------------------------
/DynamicBox/src/main/java/mehdi/sakout/dynamicbox/DynamicBox.java:
--------------------------------------------------------------------------------
1 | package mehdi.sakout.dynamicbox;
2 |
3 | import java.util.ArrayList;
4 | import java.util.Arrays;
5 | import java.util.Locale;
6 | import android.app.Activity;
7 | import android.content.Context;
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 | import android.widget.AbsListView;
12 | import android.widget.RelativeLayout;
13 | import android.widget.TextView;
14 | import android.widget.LinearLayout.LayoutParams;
15 | import android.widget.ViewSwitcher;
16 |
17 | /**
18 | *
19 | * @author Mehdi Sakout
20 | * @author Danny Tsegai
21 | *
22 | */
23 | public class DynamicBox {
24 |
25 | private View mTargetView;
26 | private View.OnClickListener mClickListener;
27 | private Context mContext;
28 | private LayoutInflater mInflater;
29 | private RelativeLayout mContainer;
30 | private ArrayList mCustomViews;
31 | private ArrayList mDefaultViews;
32 | private ViewSwitcher mSwitcher;
33 |
34 | // Default Tags
35 | private final String TAG_INTERNET_OFF = "INTERNET_OFF";
36 | private final String TAG_LOADING_CONTENT = "LOADING_CONTENT";
37 | private final String TAG_OTHER_EXCEPTION = "OTHER_EXCEPTION";
38 |
39 | private final String[] mSupportedAbsListViews = new String[]{"listview","gridview","expandablelistview"};
40 | private final String[] mSupportedViews = new String[]{"linearlayout","relativelayout", "framelayout", "scrollview", "recyclerview", "viewgroup"};
41 |
42 | public DynamicBox(Context context, View targetView){
43 | this.mContext = context;
44 | this.mInflater = ((Activity)mContext).getLayoutInflater();
45 | this.mTargetView = targetView;
46 | this.mContainer = new RelativeLayout(mContext);
47 | this.mCustomViews = new ArrayList();
48 | this.mDefaultViews = new ArrayList();
49 |
50 | Class viewClass = mTargetView.getClass();
51 | Class superViewClass = viewClass.getSuperclass();
52 | String viewType = viewClass.getName().substring(viewClass.getName().lastIndexOf('.')+1).toLowerCase(Locale.getDefault());
53 | String superViewType = superViewClass.getName().substring(superViewClass.getName().lastIndexOf('.')+1).toLowerCase(Locale.getDefault());
54 |
55 | if(Arrays.asList(mSupportedAbsListViews).contains(viewType)|| Arrays.asList(mSupportedAbsListViews).contains(superViewType))
56 | initializeAbsListView();
57 | else if(Arrays.asList(mSupportedViews).contains(viewType)|| Arrays.asList(mSupportedViews).contains(superViewType))
58 | initializeViewContainer();
59 | else
60 | throw new IllegalArgumentException("TargetView type ["+superViewType+"] is not supported !");
61 |
62 | }
63 |
64 | public DynamicBox(Context context,int viewID){
65 | this.mContext = context;
66 | this.mInflater = ((Activity)mContext).getLayoutInflater();
67 | this.mTargetView = mInflater.inflate(viewID, null, false);
68 | this.mContainer = new RelativeLayout(mContext);
69 | this.mCustomViews = new ArrayList();
70 | this.mDefaultViews = new ArrayList();
71 |
72 | Class viewClass = mTargetView.getClass();
73 | Class superViewClass = viewClass.getSuperclass();
74 | String viewType = viewClass.getName().substring(viewClass.getName().lastIndexOf('.') + 1).toLowerCase(Locale.getDefault());
75 | String superViewType = superViewClass.getName().substring(superViewClass.getName().lastIndexOf('.')+1).toLowerCase(Locale.getDefault());
76 |
77 | if(Arrays.asList(mSupportedAbsListViews).contains(viewType)|| Arrays.asList(mSupportedAbsListViews).contains(superViewType))
78 | initializeAbsListView();
79 | else if(Arrays.asList(mSupportedViews).contains(viewType)|| Arrays.asList(mSupportedViews).contains(superViewType))
80 | initializeViewContainer();
81 | else
82 | throw new IllegalArgumentException("TargetView type ["+superViewType+"] is not supported !");
83 |
84 | }
85 |
86 | private void initializeViewContainer(){
87 |
88 | setDefaultViews();
89 |
90 | mSwitcher = new ViewSwitcher(mContext);
91 | ViewSwitcher.LayoutParams params = new ViewSwitcher.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
92 | mSwitcher.setLayoutParams(params);
93 |
94 | ViewGroup group = (ViewGroup)mTargetView.getParent();
95 | int index = 0;
96 | Clonner target= new Clonner(mTargetView);
97 | if(group!=null){
98 | index = group.indexOfChild(mTargetView);
99 | group.removeView(mTargetView);
100 |
101 | }
102 |
103 | mSwitcher.addView(mContainer,0);
104 | mSwitcher.addView(target.getmView(),1);
105 | mSwitcher.setDisplayedChild(1);
106 |
107 | if(group!=null){
108 | group.addView(mSwitcher,index);
109 | }else{
110 | ((Activity)mContext).setContentView(mSwitcher);
111 | }
112 |
113 |
114 | }
115 |
116 | private void setDefaultViews(){
117 | View mLayoutInternetOff = initView(R.layout.exception_no_internet,TAG_INTERNET_OFF);
118 | View mLayoutLoadingContent = initView(R.layout.exception_loading_content,TAG_LOADING_CONTENT);
119 | View mLayoutOther = initView(R.layout.exception_failure,TAG_OTHER_EXCEPTION);
120 |
121 | mDefaultViews.add(0,mLayoutInternetOff);
122 | mDefaultViews.add(1,mLayoutLoadingContent);
123 | mDefaultViews.add(2,mLayoutOther);
124 |
125 | // Hide all layouts at first initialization
126 | mLayoutInternetOff.setVisibility(View.GONE);
127 | mLayoutLoadingContent.setVisibility(View.GONE);
128 | mLayoutOther.setVisibility(View.GONE);
129 |
130 | // init Layout params
131 | RelativeLayout.LayoutParams containerParams = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
132 | containerParams.addRule(RelativeLayout.CENTER_HORIZONTAL);
133 | containerParams.addRule(RelativeLayout.CENTER_VERTICAL);
134 |
135 | // init new RelativeLayout Wrapper
136 | mContainer.setLayoutParams(containerParams);
137 |
138 | // Add default views
139 | mContainer.addView(mLayoutLoadingContent);
140 | mContainer.addView(mLayoutInternetOff);
141 | mContainer.addView(mLayoutOther);
142 | }
143 |
144 | private void initializeAbsListView(){
145 |
146 | setDefaultViews();
147 |
148 | AbsListView abslistview = (AbsListView)mTargetView;
149 | abslistview.setVisibility(View.GONE);
150 | ViewGroup parent = (ViewGroup) abslistview.getParent();
151 | if(mContainer!=null){
152 | parent.addView(mContainer);
153 | abslistview.setEmptyView(mContainer);
154 | }else
155 | throw new IllegalArgumentException("mContainer is null !");
156 |
157 | }
158 |
159 | public void showLoadingLayout(){
160 | show(TAG_LOADING_CONTENT);
161 | }
162 | public void showInternetOffLayout(){
163 | show(TAG_INTERNET_OFF);
164 | }
165 | public void showExceptionLayout(){
166 | show(TAG_OTHER_EXCEPTION);
167 | }
168 | public void showCustomView(String tag){
169 | show(tag);
170 | }
171 |
172 | public void hideAll(){
173 | ArrayList views = new ArrayList(mDefaultViews);
174 | views.addAll(mCustomViews);
175 | for(View view : views){
176 | view.setVisibility(View.GONE);
177 | }
178 | if(mSwitcher!=null){
179 | mSwitcher.setDisplayedChild(1);
180 | }
181 | }
182 | private void show(String tag){
183 | ArrayList views = new ArrayList(mDefaultViews);
184 | views.addAll(mCustomViews);
185 | for(View view : views){
186 | if(view.getTag()!=null && view.getTag().toString().equals(tag)){
187 | view.setVisibility(View.VISIBLE);
188 | }else{
189 | view.setVisibility(View.GONE);
190 | }
191 | }
192 | if(mSwitcher!=null && mSwitcher.getDisplayedChild()!=0){
193 | mSwitcher.setDisplayedChild(0);
194 | }
195 | }
196 | /**
197 | * Return a view based on layout id
198 | * @param layout Layout Id
199 | * @param tag Layout Tag
200 | * @return View
201 | */
202 | private View initView(int layout, String tag){
203 | View view = mInflater.inflate(layout, null,false);
204 |
205 | view.setTag(tag);
206 | view.setVisibility(View.GONE);
207 |
208 | View buttonView = view.findViewById(R.id.exception_button);
209 | if(buttonView!=null)
210 | buttonView.setOnClickListener(this.mClickListener);
211 |
212 | return view;
213 | }
214 | /**
215 | *
216 | * @see Android Design Guidelines for Activity Circles
217 | * @deprecated This method has been deprecated because it does not adhere to the Android design guidelines. Activity circle's should not display any text.
218 | *
219 | */
220 | public void setLoadingMessage(String message){
221 | ((TextView)mDefaultViews.get(1).findViewById(R.id.exception_message)).setText(message);
222 | }
223 | public void setInternetOffMessage(String message){
224 | ((TextView)mDefaultViews.get(0).findViewById(R.id.exception_message)).setText(message);
225 | }
226 | public void setOtherExceptionMessage(String message){
227 | ((TextView)mDefaultViews.get(2).findViewById(R.id.exception_message)).setText(message);
228 | }
229 | public void setInternetOffTitle(String message){
230 | ((TextView)mDefaultViews.get(0).findViewById(R.id.exception_title)).setText(message);
231 | }
232 | public void setOtherExceptionTitle(String message){
233 | ((TextView)mDefaultViews.get(2).findViewById(R.id.exception_title)).setText(message);
234 | }
235 | public void setClickListener(View.OnClickListener clickListener){
236 |
237 | this.mClickListener = clickListener;
238 |
239 | for(View view : mDefaultViews){
240 | View buttonView = view.findViewById(R.id.exception_button);
241 | if(buttonView!=null)
242 | buttonView.setOnClickListener(this.mClickListener);
243 | }
244 |
245 |
246 | }
247 |
248 | public void addCustomView(View customView,String tag){
249 |
250 | customView.setTag(tag);
251 | customView.setVisibility(View.GONE);
252 | mCustomViews.add(customView);
253 | mContainer.addView(customView);
254 | }
255 | private class Clonner{
256 | private View mView;
257 |
258 | public Clonner(View view){
259 | this.setmView(view);
260 | }
261 |
262 | public View getmView() {
263 | return mView;
264 | }
265 |
266 | public void setmView(View mView) {
267 | this.mView = mView;
268 | }
269 | }
270 | }
--------------------------------------------------------------------------------
/DynamicBox/src/main/res/layout/exception_failure.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
12 |
22 |
23 |
29 |
30 |
34 |
35 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/DynamicBox/src/main/res/layout/exception_loading_content.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
12 |
23 |
24 |
31 |
32 |
37 |
38 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/DynamicBox/src/main/res/layout/exception_no_internet.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
15 |
25 |
26 |
32 |
33 |
37 |
38 |
39 |
40 |
41 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/DynamicBox/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #5fcf80
5 | #35c460
6 | #ff6a7983
7 | #8c989e
8 |
9 |
--------------------------------------------------------------------------------
/DynamicBox/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DynamicBox
5 | empty
6 | Retry
7 |
8 |
9 |
10 |
11 | Error
12 | Internet is off, please enable it
13 |
14 | Error
15 | An error has occurred, retry again
16 |
17 |
18 |
--------------------------------------------------------------------------------
/DynamicBox/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
14 |
23 |
24 |
27 |
28 |
--------------------------------------------------------------------------------
/DynamicBoxExample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/DynamicBoxExample/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'android'
2 |
3 | repositories {
4 | mavenCentral()
5 | }
6 |
7 | android {
8 | compileSdkVersion 22
9 | buildToolsVersion "22.0.1"
10 |
11 | defaultConfig {
12 | minSdkVersion 8
13 | targetSdkVersion 22
14 | }
15 | buildTypes {
16 | release {
17 | minifyEnabled false
18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
19 | }
20 | }
21 | }
22 |
23 | dependencies {
24 | compile 'com.android.support:appcompat-v7:22.2.1'
25 | compile project(':DynamicBox')
26 | compile fileTree(dir: 'libs', include: ['*.jar'])
27 | }
28 |
--------------------------------------------------------------------------------
/DynamicBoxExample/gradle.properties:
--------------------------------------------------------------------------------
1 | VERSION_NAME=1.1
2 | VERSION_CODE=2
3 | GROUP=com.github.medyo
4 | POM_DESCRIPTION=Dynamicbox lib
5 | POM_URL=https://github.com/medyo/dynamicbox
6 | POM_SCM_URL=https://github.com/medyo/dynamicbox
7 | POM_SCM_CONNECTION=scm:git@github.com:medyo/dynamicbox.git
8 | POM_SCM_DEV_CONNECTION=scm:git@github.com:medyo/dynamicbox.git
9 | POM_LICENCE_NAME=MIT
10 | POM_LICENCE_URL=http://opensource.org/licenses/MIT
11 | POM_LICENCE_DIST=repo
12 | POM_DEVELOPER_ID=medyo
13 | POM_DEVELOPER_NAME=Mehdi Sakout
14 |
15 | POM_NAME=Dynamicbox Library
16 | POM_ARTIFACT_ID=dynamicbox
17 | POM_PACKAGING=aar
--------------------------------------------------------------------------------
/DynamicBoxExample/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
16 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
28 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/DynamicBoxExample/src/main/java/mehdi/sakout/dynamicboxexample/ActivityActivity.java:
--------------------------------------------------------------------------------
1 | package mehdi.sakout.dynamicboxexample;
2 |
3 | import android.os.Bundle;
4 | import android.os.Handler;
5 | import android.support.v7.app.ActionBarActivity;
6 | import android.view.View;
7 | import mehdi.sakout.dynamicbox.DynamicBox;
8 |
9 | /**
10 | * Created by Medyo.
11 | */
12 | public class ActivityActivity extends ActionBarActivity {
13 | DynamicBox box ;
14 | boolean firstLaunch = false;
15 | public void onCreate(Bundle savedInstanceState) {
16 | super.onCreate(savedInstanceState);
17 |
18 | // Drop this line ! it's a bomb
19 | //setContentView(R.layout.activity_activity);
20 |
21 | box = new DynamicBox(this,R.layout.activity_activity);
22 |
23 | // Setup my box
24 | box.setLoadingMessage("Loading content...");
25 | box.setOtherExceptionTitle("Error");
26 | box.setOtherExceptionMessage("An error has occurred while fetching data, please try again ...");
27 | box.setClickListener(new View.OnClickListener() {
28 | @Override
29 | public void onClick(View view) {
30 | myHeavyWork();
31 | }
32 | });
33 |
34 | // Call my fake HeavyWork Method
35 | myHeavyWork();
36 |
37 |
38 | }
39 | private void myHeavyWork(){
40 |
41 | box.showLoadingLayout();
42 |
43 | // Wait 2 seconds before showing result
44 | new Handler().postDelayed(new Runnable() {
45 | public void run() {
46 |
47 | // I made this trick just to get an error Exception first then the activity content after.
48 | firstLaunch = !firstLaunch;
49 | if(firstLaunch)
50 | box.showExceptionLayout();
51 | else
52 | box.hideAll();
53 | }
54 | }, 2000);
55 |
56 | }
57 | }
--------------------------------------------------------------------------------
/DynamicBoxExample/src/main/java/mehdi/sakout/dynamicboxexample/ListViewActivity.java:
--------------------------------------------------------------------------------
1 | package mehdi.sakout.dynamicboxexample;
2 |
3 | import android.os.Bundle;
4 | import android.os.Handler;
5 | import android.support.v7.app.ActionBarActivity;
6 | import android.view.View;
7 | import android.widget.Button;
8 | import android.widget.ListView;
9 | import android.widget.Toast;
10 | import mehdi.sakout.dynamicbox.DynamicBox;
11 |
12 | /**
13 | * Created by Medyo.
14 | */
15 | public class ListViewActivity extends ActionBarActivity {
16 |
17 | DynamicBox box;
18 | Button btn_loadingView;
19 | Button btn_customException;
20 | Button btn_noInternet;
21 |
22 | public void onCreate(Bundle savedInstanceState) {
23 | super.onCreate(savedInstanceState);
24 | setContentView(R.layout.activity_listview);
25 |
26 | ListView lv = (ListView)findViewById(R.id.listView);
27 |
28 | // Setup by Box
29 | box = new DynamicBox(this,lv); // or new DynamicBox(this,R.id.listView)
30 | box.setLoadingMessage("Loading your music ...");
31 | View emptyCollectionView = getLayoutInflater().inflate(R.layout.music_not_found, null, false);
32 | box.addCustomView(emptyCollectionView,"music_not_found");
33 | box.setClickListener(new View.OnClickListener() {
34 | @Override
35 | public void onClick(View view) {
36 | Toast.makeText(getApplicationContext(), "Retry button clicked :)", Toast.LENGTH_SHORT).show();
37 | }
38 | });
39 |
40 | box.showLoadingLayout();
41 |
42 | new Handler().postDelayed(new Runnable() {
43 | public void run() {
44 | box.showCustomView("music_not_found");
45 | }
46 | }, 2000);
47 |
48 |
49 | }
50 |
51 |
52 | }
--------------------------------------------------------------------------------
/DynamicBoxExample/src/main/java/mehdi/sakout/dynamicboxexample/MainActivity.java:
--------------------------------------------------------------------------------
1 | package mehdi.sakout.dynamicboxexample;
2 |
3 |
4 | import android.app.ListActivity;
5 | import android.content.Intent;
6 | import android.os.Bundle;
7 | import android.view.View;
8 | import android.widget.AdapterView;
9 | import android.widget.ArrayAdapter;
10 | import android.widget.AdapterView.OnItemClickListener;
11 |
12 | public class MainActivity extends ListActivity implements OnItemClickListener{
13 |
14 | @Override
15 | protected void onCreate(Bundle savedInstanceState) {
16 | super.onCreate(savedInstanceState);
17 | setContentView(R.layout.activity_main);
18 |
19 | setListAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_1, listItems));
20 | getListView().setOnItemClickListener(this);
21 | }
22 |
23 |
24 | String[] listItems = {"Simple View", "Custom View",};
25 |
26 | @Override
27 | public void onItemClick(AdapterView> adapterView, View view, int position, long id) {
28 | switch(position){
29 | case 0 :
30 | Intent intentActivity = new Intent(MainActivity.this,ActivityActivity.class);
31 | startActivity(intentActivity);
32 |
33 | break;
34 | case 1 :
35 | Intent intentList = new Intent(MainActivity.this,ListViewActivity.class);
36 | startActivity(intentList);
37 | break;
38 | default: throw new IllegalArgumentException("Hold up, hold my phone :)");
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/DynamicBoxExample/src/main/res/drawable-hdpi/green_monster.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medyo/Dynamicbox/dbb8f214f8796f76b9eae80908b2eff5f1813136/DynamicBoxExample/src/main/res/drawable-hdpi/green_monster.png
--------------------------------------------------------------------------------
/DynamicBoxExample/src/main/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medyo/Dynamicbox/dbb8f214f8796f76b9eae80908b2eff5f1813136/DynamicBoxExample/src/main/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DynamicBoxExample/src/main/res/drawable-hdpi/nature.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medyo/Dynamicbox/dbb8f214f8796f76b9eae80908b2eff5f1813136/DynamicBoxExample/src/main/res/drawable-hdpi/nature.jpg
--------------------------------------------------------------------------------
/DynamicBoxExample/src/main/res/drawable-hdpi/saxophone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medyo/Dynamicbox/dbb8f214f8796f76b9eae80908b2eff5f1813136/DynamicBoxExample/src/main/res/drawable-hdpi/saxophone.png
--------------------------------------------------------------------------------
/DynamicBoxExample/src/main/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medyo/Dynamicbox/dbb8f214f8796f76b9eae80908b2eff5f1813136/DynamicBoxExample/src/main/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DynamicBoxExample/src/main/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medyo/Dynamicbox/dbb8f214f8796f76b9eae80908b2eff5f1813136/DynamicBoxExample/src/main/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DynamicBoxExample/src/main/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medyo/Dynamicbox/dbb8f214f8796f76b9eae80908b2eff5f1813136/DynamicBoxExample/src/main/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/DynamicBoxExample/src/main/res/layout/activity_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
12 |
13 |
20 |
21 |
26 |
27 |
34 |
35 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/DynamicBoxExample/src/main/res/layout/activity_listview.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
--------------------------------------------------------------------------------
/DynamicBoxExample/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
13 |
14 |
--------------------------------------------------------------------------------
/DynamicBoxExample/src/main/res/layout/music_not_found.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
13 |
14 |
20 |
21 |
31 |
32 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/DynamicBoxExample/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/DynamicBoxExample/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
7 |
--------------------------------------------------------------------------------
/DynamicBoxExample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DynamicBoxExample
5 | Hello world!
6 | Settings
7 | FragmentActivity
8 |
9 | Nature can bring a lot of beauty into our lives. Nature has a way of affecting our moods and it can force us to change our plans. Nature is responsible for the sun, clouds, rain, and snow. When it is sunny and bright outside, we feel cheerful inside. When it is cloudy and rainy, we often feel gloomy. When there is a beautiful and starry night, the moonlight makes us feel romantic. When we see the leaves budding on a tree or when a timid flower pushes through the frozen ground, or when we smell the freshness of spring, new hope will always come to us. Nature is truly an intrinsic part of our lives. When we wake and see a sunrise, when we walk and feel a breeze, when we gaze at the mountains and the splendor of the seas, when we see the earth renew its beauty at each season of the year, and when the stars shine at night, we should be so very thankful to the Lord for giving us all these wonderful and miraculous things. Learning to become more aware of nature can truly have a good effect on our lives in the way we look at things and in the way we feel about ourselves.
10 |
11 |
12 |
--------------------------------------------------------------------------------
/DynamicBoxExample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Dynamicbox
2 | ==========
3 |
4 | # Deprecated, Please refer the new implementation at: https://github.com/medyo/StateViews
5 |
6 | 
7 |
8 | DynamicBox is a library which inflates custom layouts to indicate :
9 |
10 | * loading content
11 | * show an exception
12 | * or even a custom view.
13 |
14 | The philosophy behind this library is to improve the UX through informing the user about what's happening behind, if the data is loading or an exception is thrown while fetching data...
15 |
16 | Screenshots
17 | ---
18 |
19 |
20 |
21 | __Supports:__
22 |
23 | - `ListView`
24 | - `GridView`
25 | - `ExpandableListView`
26 | - `Activity`
27 | - `FragmentActivity`
28 | - `Fragment`
29 | - `LinearLayout`
30 | - `RelativeLayout`
31 | - `ScrollView`
32 | - `FrameLayout`
33 | - `RecyclerView`
34 | - `ViewGroup`
35 | - `or any view type overriding from one of these`
36 |
37 | Including in your project : Maven Central
38 | ---------------------
39 |
40 | ```compile 'com.github.medyo:dynamicbox:1.2@aar'```
41 |
42 | Usage
43 | ---------------------
44 |
45 | ```
46 | DynamicBox box = new DynamicBox(this,view);
47 | ```
48 | *`this` : refers to the current Activity*
49 | *`view` : refers to the target view, eg a ListView or a layout*
50 |
51 | Example
52 | ---------------------
53 |
54 | - View
55 |
56 | ```
57 | ListView lv = (ListView)findViewById(R.id.listView);
58 | DynamicBox box = new DynamicBox(this,lv);
59 | ```
60 |
61 | - Layout id
62 |
63 | ```
64 | DynamicBox box = new DynamicBox(this,R.layout.activity_activity);
65 | ```
66 | _____
67 |
68 | **To Show the loading View**
69 | ```
70 | box.showLoadingLayout();
71 | ```
72 |
73 | **To Show Internet off View**
74 | ```
75 | box.showInternetOffLayout();
76 | ```
77 |
78 | **To Show Exception View**
79 | ```
80 | box.showExceptionLayout();
81 | ```
82 |
83 | **To Show a Custom View**
84 | ```
85 | View customView = getLayoutInflater().inflate(R.layout.custom_view, null, false);
86 | box.addCustomView(customView,"greenmonster");
87 | box.showCustomView("greenmonster");
88 | ```
89 |
90 | **To set Loading Message**
91 | ```
92 | box.setLoadingMessage("Loading your music ...");
93 | ```
94 |
95 | **To Override Strings**
96 | Please refer to [strings.xml variables](DynamicBox/src/main/res/values/strings.xml)
97 |
98 | **To Override Default style**
99 | Please refer to [styles.xml](DynamicBox/src/main/res/values/styles.xml)
100 |
101 | **To Override Default Layouts**
102 | Please refer to [res/layouts](DynamicBox/src/main/res/layout/)
103 |
104 | **See the example project for more details** [Sample](DynamicBoxExample/src/main/java/mehdi/sakout/dynamicboxexample/)
105 |
106 | Apps using DynamicBox
107 | ---------------------
108 | [](https://play.google.com/store/apps/details?id=com.mobiacube.elbotola)
109 |
110 | Feel free to shoot me an email if your app is using it
111 |
112 | Developed By
113 | ---------------------
114 | El Mehdi Sakout
115 |
116 | Resources
117 | ---------------------
118 | Thanks to [IconKa](http://www.iconka.com) for the cat icon.
119 |
120 | License
121 | ---------------------
122 |
123 | MIT
124 | [http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT)
125 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | jcenter()
4 | mavenCentral()
5 | }
6 | dependencies {
7 | classpath 'com.android.tools.build:gradle:1.3.0'
8 | }
9 | }
10 | def isReleaseBuild() {
11 | return version.contains("SNAPSHOT") == false
12 | }
13 | allprojects {
14 | version = VERSION_NAME
15 | group = GROUP
16 | repositories {
17 | mavenCentral()
18 | }
19 | }
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | VERSION_NAME=1.2
2 | VERSION_CODE=2
3 | GROUP=com.github.medyo
4 | POM_DESCRIPTION=DynamicBox lib
5 | POM_URL=https://github.com/medyo/dynamicbox
6 | POM_SCM_URL=https://github.com/medyo/dynamicbox
7 | POM_SCM_CONNECTION=scm:git@github.com:medyo/dynamicbox.git
8 | POM_SCM_DEV_CONNECTION=scm:git@github.com:medyo/dynamicbox.git
9 | POM_LICENCE_NAME=MIT
10 | POM_LICENCE_URL=http://opensource.org/licenses/MIT
11 | POM_LICENCE_DIST=repo
12 | POM_DEVELOPER_ID=medyo
13 | POM_DEVELOPER_NAME=Mehdi Sakout
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medyo/Dynamicbox/dbb8f214f8796f76b9eae80908b2eff5f1813136/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Apr 08 13:44:50 WEST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/maven_push.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'maven'
2 | apply plugin: 'signing'
3 |
4 | def isReleaseBuild() {
5 | return VERSION_NAME.contains("SNAPSHOT") == false
6 | }
7 |
8 | def getReleaseRepositoryUrl() {
9 | return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL
10 | : "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
11 | }
12 |
13 | def getSnapshotRepositoryUrl() {
14 | return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL
15 | : "https://oss.sonatype.org/content/repositories/snapshots/"
16 | }
17 |
18 | def getRepositoryUsername() {
19 | return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : ""
20 | }
21 |
22 | def getRepositoryPassword() {
23 | return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : ""
24 | }
25 | println 'GROUP = '+GROUP
26 | afterEvaluate { project ->
27 | uploadArchives {
28 | repositories {
29 | mavenDeployer {
30 | beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
31 |
32 | pom.groupId = GROUP
33 | pom.artifactId = POM_ARTIFACT_ID
34 | pom.version = VERSION_NAME
35 |
36 | repository(url: getReleaseRepositoryUrl()) {
37 | authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
38 | }
39 | snapshotRepository(url: getSnapshotRepositoryUrl()) {
40 | authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
41 | }
42 |
43 | pom.project {
44 | name POM_NAME
45 | packaging POM_PACKAGING
46 | description POM_DESCRIPTION
47 | url POM_URL
48 |
49 | scm {
50 | url POM_SCM_URL
51 | connection POM_SCM_CONNECTION
52 | developerConnection POM_SCM_DEV_CONNECTION
53 | }
54 |
55 | licenses {
56 | license {
57 | name POM_LICENCE_NAME
58 | url POM_LICENCE_URL
59 | distribution POM_LICENCE_DIST
60 | }
61 | }
62 |
63 | developers {
64 | developer {
65 | id POM_DEVELOPER_ID
66 | name POM_DEVELOPER_NAME
67 | }
68 | }
69 | }
70 | }
71 | }
72 | }
73 |
74 | signing {
75 | required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
76 | sign configurations.archives
77 | }
78 |
79 | task androidJavadocs(type: Javadoc) {
80 | source = android.sourceSets.main.java.srcDirs
81 | classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
82 | }
83 |
84 | task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
85 | classifier = 'javadoc'
86 | from androidJavadocs.destinationDir
87 | }
88 |
89 | task androidSourcesJar(type: Jar) {
90 | classifier = 'sources'
91 | from android.sourceSets.main.java.sourceFiles
92 | }
93 |
94 | artifacts {
95 | archives androidSourcesJar
96 | archives androidJavadocsJar
97 | }
98 | }
--------------------------------------------------------------------------------
/screenshots/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medyo/Dynamicbox/dbb8f214f8796f76b9eae80908b2eff5f1813136/screenshots/1.png
--------------------------------------------------------------------------------
/screenshots/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medyo/Dynamicbox/dbb8f214f8796f76b9eae80908b2eff5f1813136/screenshots/2.png
--------------------------------------------------------------------------------
/screenshots/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medyo/Dynamicbox/dbb8f214f8796f76b9eae80908b2eff5f1813136/screenshots/3.png
--------------------------------------------------------------------------------
/screenshots/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medyo/Dynamicbox/dbb8f214f8796f76b9eae80908b2eff5f1813136/screenshots/4.png
--------------------------------------------------------------------------------
/screenshots/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medyo/Dynamicbox/dbb8f214f8796f76b9eae80908b2eff5f1813136/screenshots/5.png
--------------------------------------------------------------------------------
/screenshots/apps/com.mobiacube.elbotola.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medyo/Dynamicbox/dbb8f214f8796f76b9eae80908b2eff5f1813136/screenshots/apps/com.mobiacube.elbotola.png
--------------------------------------------------------------------------------
/screenshots/cat-box-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medyo/Dynamicbox/dbb8f214f8796f76b9eae80908b2eff5f1813136/screenshots/cat-box-icon.png
--------------------------------------------------------------------------------
/screenshots/demo_gmail_no_messages.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medyo/Dynamicbox/dbb8f214f8796f76b9eae80908b2eff5f1813136/screenshots/demo_gmail_no_messages.png
--------------------------------------------------------------------------------
/screenshots/demo_gplay_no_internet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medyo/Dynamicbox/dbb8f214f8796f76b9eae80908b2eff5f1813136/screenshots/demo_gplay_no_internet.png
--------------------------------------------------------------------------------
/screenshots/demo_popcorn_loading.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medyo/Dynamicbox/dbb8f214f8796f76b9eae80908b2eff5f1813136/screenshots/demo_popcorn_loading.png
--------------------------------------------------------------------------------
/screenshots/demo_slack_loading.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/medyo/Dynamicbox/dbb8f214f8796f76b9eae80908b2eff5f1813136/screenshots/demo_slack_loading.png
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':DynamicBoxExample' ,'DynamicBox'
--------------------------------------------------------------------------------