Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

Commit

Permalink
[WIP]: organizing code
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier de Pedro López committed Jul 13, 2016
1 parent 81d770a commit a37ffc7
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 96 deletions.
2 changes: 1 addition & 1 deletion demo-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'android-apt'
apply plugin: 'com.squareup.sqldelight'

def ipAddress = "\"http://192.168.16.134:3000\""
def ipAddress = "\"http://192.168.16.124:3000\""

android {
compileSdkVersion 23
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.mobgen.droidcon.offline.sdk.models.Post;
import com.mobgen.droidcon.offline.sdk.repository.PostRepository;
import com.mobgen.droidcon.offline.sdk.repository.RepositoryException;
import com.mobgen.droidcon.offline.sdk.sync.loaders.PostLoader;
import com.mobgen.droidcon.offline.shared.loaders.PostLoader;
import com.mobgen.droidcon.offline.shared.adapters.PostAdapter;
import com.mobgen.droidcon.offline.shared.ui.BasePostActivity;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.mobgen.droidcon.offline.sdk.models.Post;
import com.mobgen.droidcon.offline.sdk.repository.PostRepository;
import com.mobgen.droidcon.offline.sdk.repository.RepositoryException;
import com.mobgen.droidcon.offline.sdk.sync.loaders.CommentLoader;
import com.mobgen.droidcon.offline.shared.loaders.CommentLoader;
import com.mobgen.droidcon.offline.shared.ui.BasePostDetailsActivity;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void bind(@NonNull Post post) {
mRemoveButton.setVisibility(View.GONE);
int commentColor = R.color.white;
if (post.isNew()) {
commentColor = R.color.colorAccent;
commentColor = R.color.addedColor;
} else if (post.isDeleted()) {
commentColor = R.color.deletedColor;
}
Expand All @@ -118,7 +118,7 @@ public void bind(@NonNull Comment comment) {
int commentColor = R.color.white;
mRemoveButton.setVisibility(View.VISIBLE);
if (comment.isNew()) {
commentColor = R.color.colorAccent;
commentColor = R.color.addedColor;
} else if (comment.isDeleted()) {
commentColor = R.color.deletedColor;
mRemoveButton.setVisibility(View.GONE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void bind(@NonNull Post post) {
mDelete.setVisibility(View.VISIBLE);
int colorPost = R.color.white;
if (post.isNew()) {
colorPost = R.color.colorAccent;
colorPost = R.color.addedColor;
} else if (post.isDeleted()) {
colorPost = R.color.deletedColor;
mDelete.setVisibility(View.GONE);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mobgen.droidcon.offline.sdk.sync.loaders;
package com.mobgen.droidcon.offline.shared.loaders;

import android.content.Context;
import android.support.annotation.Nullable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mobgen.droidcon.offline.sdk.sync.loaders;
package com.mobgen.droidcon.offline.shared.loaders;

import android.content.BroadcastReceiver;
import android.content.Context;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mobgen.droidcon.offline.sdk.sync.loaders;
package com.mobgen.droidcon.offline.shared.loaders;

import android.content.BroadcastReceiver;
import android.content.Context;
Expand Down
2 changes: 1 addition & 1 deletion demo/src/main/res/layout/activity_post_details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/error_net_lost"
android:textColor="@color/colorAccent" />
android:textColor="@color/white" />
</LinearLayout>

<RelativeLayout
Expand Down
2 changes: 1 addition & 1 deletion demo/src/main/res/layout/activity_post_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/error_net_lost"
android:textColor="@color/colorAccent" />
android:textColor="@color/white" />
</LinearLayout>

<RelativeLayout
Expand Down
9 changes: 5 additions & 4 deletions demo/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#4CAF50</color>
<color name="colorPrimary">#087E8B</color>
<color name="colorPrimaryDark">#104547</color>
<color name="colorAccent">#0E1C36</color>

<color name="deletedColor">#F06292</color>
<color name="deletedColor">#E84855</color>
<color name="addedColor">#4CAF50</color>
<color name="white">#FFFFFF</color>
</resources>
86 changes: 5 additions & 81 deletions server/json_server.json
Original file line number Diff line number Diff line change
Expand Up @@ -585,19 +585,11 @@
"deletedAt": null
},
{
"id": 97,
"title": "quas fugiat ut perspiciatis vero provident",
"body": "eum non blanditiis soluta porro quibusdam voluptas\nvel voluptatem qui placeat dolores qui velit aut\nvel inventore aut cumque culpa explicabo aliquid at\nperspiciatis est et voluptatem dignissimos dolor itaque sit nam",
"createdAt": 0,
"updatedAt": 0,
"deletedAt": null
},
{
"body": "udibz",
"createdAt": 1468235322208,
"needsSync": false,
"title": "gzhjz",
"id": 100
"body": "Sample",
"createdAt": 1468428120930,
"needsSync": true,
"title": "Sample",
"id": 98
}
],
"comments": [
Expand Down Expand Up @@ -4250,74 +4242,6 @@
"createdAt": 0,
"updatedAt": 0,
"deletedAt": null
},
{
"postId": 97,
"id": 481,
"name": "recusandae dolor similique autem saepe voluptate aut vel sit",
"email": "Domenick@russell.ca",
"body": "dignissimos nobis vitae corporis delectus eligendi et ut ut\namet laudantium neque\net quia cupiditate debitis aliquid\ndolorem aspernatur libero aut autem quo et",
"createdAt": 0,
"updatedAt": 0,
"deletedAt": null
},
{
"postId": 97,
"id": 482,
"name": "placeat eveniet sunt ut quis",
"email": "Chanelle@samson.me",
"body": "aliquid natus voluptas doloremque fugiat ratione adipisci\nunde eum facilis enim omnis ipsum nobis nihil praesentium\nut blanditiis voluptatem veniam\ntenetur fugit et distinctio aspernatur",
"createdAt": 0,
"updatedAt": 0,
"deletedAt": null
},
{
"postId": 97,
"id": 483,
"name": "a ipsa nihil sed impedit",
"email": "Hermann.Kunde@rosina.us",
"body": "quos aut rerum nihil est et\ndolores commodi voluptas voluptatem excepturi et\net expedita dignissimos atque aut reprehenderit\nquis quo soluta",
"createdAt": 0,
"updatedAt": 0,
"deletedAt": null
},
{
"postId": 97,
"id": 484,
"name": "hic inventore sint aut",
"email": "Olen@bryce.net",
"body": "vel libero quo sit vitae\nid nesciunt ipsam non a aut enim itaque totam\nillum est cupiditate sit\nnam exercitationem magnam veniam",
"createdAt": 0,
"updatedAt": 0,
"deletedAt": null
},
{
"postId": 97,
"id": 485,
"name": "enim asperiores illum",
"email": "Lorenza.Carter@consuelo.ca",
"body": "soluta quia porro mollitia eos accusamus\nvoluptatem illo perferendis earum quia\nquo sed ipsam in omnis cum earum tempore eos\nvoluptatem illum doloremque corporis ipsam facere",
"createdAt": 0,
"updatedAt": 0,
"deletedAt": null
},
{
"body": " zbzbs",
"createdAt": 1468235338487,
"email": "gshzv",
"name": "bBah",
"needsSync": false,
"postId": 100,
"id": 486
},
{
"body": "hzkbs",
"createdAt": 1468235343349,
"email": "gzjz",
"name": "v zjzu",
"needsSync": false,
"postId": 100,
"id": 487
}
]
}

0 comments on commit a37ffc7

Please sign in to comment.