Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Surya
committed
Feb 11, 2019
1 parent
59e08c5
commit 5f27122
Showing
25 changed files
with
798 additions
and
58 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
app/src/main/java/com/androidwave/cleancode/data/network/RestApiHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
package com.androidwave.cleancode.data.network; | ||
|
||
import com.androidwave.cleancode.data.network.pojo.FeedItem; | ||
import com.androidwave.cleancode.data.network.pojo.LoginRequest; | ||
import com.androidwave.cleancode.data.network.pojo.UserProfile; | ||
import com.androidwave.cleancode.data.network.pojo.WrapperResponse; | ||
|
||
import java.util.List; | ||
|
||
import io.reactivex.Single; | ||
|
||
public interface RestApiHelper { | ||
|
||
Single<WrapperResponse<UserProfile>> doLoginApiCall(LoginRequest request); | ||
|
||
Single<WrapperResponse<List<FeedItem>>> getFeedList(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
app/src/main/java/com/androidwave/cleancode/data/network/pojo/FeedItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
|
||
package com.androidwave.cleancode.data.network.pojo; | ||
|
||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
@SuppressWarnings("unused") | ||
public class FeedItem { | ||
|
||
@SerializedName("author") | ||
private String mAuthor; | ||
@SerializedName("description") | ||
private String mDescription; | ||
@SerializedName("link") | ||
private String mLink; | ||
@SerializedName("pubDate") | ||
private String mPubDate; | ||
@SerializedName("thumbnail") | ||
private String mThumbnail; | ||
@SerializedName("title") | ||
private String mTitle; | ||
|
||
public String getAuthor() { | ||
return mAuthor; | ||
} | ||
|
||
public void setAuthor(String author) { | ||
mAuthor = author; | ||
} | ||
|
||
public String getDescription() { | ||
return mDescription; | ||
} | ||
|
||
public void setDescription(String description) { | ||
mDescription = description; | ||
} | ||
|
||
public String getLink() { | ||
return mLink; | ||
} | ||
|
||
public void setLink(String link) { | ||
mLink = link; | ||
} | ||
|
||
public String getPubDate() { | ||
return mPubDate; | ||
} | ||
|
||
public void setPubDate(String pubDate) { | ||
mPubDate = pubDate; | ||
} | ||
|
||
public String getThumbnail() { | ||
return mThumbnail; | ||
} | ||
|
||
public void setThumbnail(String thumbnail) { | ||
mThumbnail = thumbnail; | ||
} | ||
|
||
public String getTitle() { | ||
return mTitle; | ||
} | ||
|
||
public void setTitle(String title) { | ||
mTitle = title; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
app/src/main/java/com/androidwave/cleancode/ui/base/BaseViewHolder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.androidwave.cleancode.ui.base; | ||
|
||
import android.view.View; | ||
|
||
import androidx.recyclerview.widget.RecyclerView; | ||
|
||
/** | ||
* Created on : Feb 11, 2019 | ||
* Author : AndroidWave | ||
*/ | ||
public abstract class BaseViewHolder extends RecyclerView.ViewHolder { | ||
|
||
private int mCurrentPosition; | ||
|
||
public BaseViewHolder(View itemView) { | ||
super(itemView); | ||
} | ||
|
||
protected abstract void clear(); | ||
|
||
public void onBind(int position) { | ||
mCurrentPosition = position; | ||
clear(); | ||
} | ||
|
||
public int getCurrentPosition() { | ||
return mCurrentPosition; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.