1919import android .graphics .Color ;
2020import dev .ahamed .mva .sample .R ;
2121import dev .ahamed .mva .sample .data .model .ColoredItem ;
22+ import dev .ahamed .mva .sample .data .model .Comment ;
2223import dev .ahamed .mva .sample .data .model .FaqItem ;
23- import dev .ahamed .mva .sample .data .model .MoviePosterItem ;
2424import dev .ahamed .mva .sample .data .model .NewsItem ;
2525import dev .ahamed .mva .sample .data .model .NumberItem ;
26+ import dev .ahamed .mva .sample .data .model .Person ;
2627import dev .ahamed .mva .sample .data .model .SelectableItem ;
2728import dev .ahamed .mva .sample .data .model .TextItem ;
2829import java .util .ArrayList ;
@@ -38,7 +39,7 @@ public class DataManager {
3839 Color .parseColor ("#FFAB91" )
3940 };
4041 private static final int [] newsThumbnails = new int [] {
41- R .drawable .ic_circle , R .drawable .ic_heart , R .drawable .ic_star
42+ R .drawable .ic_circle_variant , R .drawable .ic_heart , R .drawable .ic_star
4243 };
4344 private static String [] newsDummyTitles = {
4445 "Introducing new Android Excellence apps and games on Google Play " ,
@@ -47,12 +48,6 @@ public class DataManager {
4748 "Announcing Apps for Android and Google developer podcast" ,
4849 "Congrats to the new Android Excellence apps and games on Google Play "
4950 };
50- //private static String[] movieNames = {
51- // "A", "B", "C", "D", "E", "F", "G", "H", "I"
52- //};
53- private static String [] movieNames = {
54- "A" , "B" , "C" , "D"
55- };
5651 private static String [] languages = {
5752 "Arabic" , "English" , "French" , "Hindi" , "Russian" , "Spanish"
5853 };
@@ -69,6 +64,51 @@ public class DataManager {
6964 private static String [] websites = {
7065 "Reddit" , "Google News" , "Yahoo News" , "Huffington Post" , "Reuters"
7166 };
67+ private static String [] cast = {
68+ "Tony Stark" , "Hans Olo" , "Alice" , "Petey Cruiser"
69+ };
70+ private static String [] castOverline = {
71+ "as ROBIN BANKS" , "as LUKE WARM" , "as MARIA HILL" , "as PETE SARIYA"
72+ };
73+ private static String [] crew = {
74+ "John Doe" , "Jane Doe" , "Mario Speedwagon" , "Rick O'Shea"
75+ };
76+ private static String [] crewOverline = {
77+ "DIRECTOR" , "DIRECTOR" , "WRITER" , "WRITER"
78+ };
79+ private static String [] producer = {
80+ "Monty Carlo" , "Jimmy Changa" , "Barry Wine" , "Buster Hyman"
81+ };
82+ private static String [] producerOverline = {
83+ "EXECUTIVE PRODUCER" , "PRODUCER" , "PRODUCER" , "ASSOCIATE PRODUCER"
84+ };
85+ private static String [] authors = {
86+ "Concurag" , "CrazyBilki" , "emakerOf" , "patA1" , "trollicon" , "iAmThere" , "silento" ,
87+ "silentreader"
88+ };
89+ private static String [] comments = {
90+ "You are so inspiring! Such illustration, many avatar, so sublime" ,
91+ "Vastly sick notification :-) Just fab, friend." ,
92+ "Excellent =) I want to make love to the use of button and background image!" ,
93+ "Sleek work you have here. Let me take a nap... great shot, anyway." ,
94+ "Nice use of violet in this shot :-) Mission accomplished. It's strong :-)" ,
95+ "These are graceful and engaging mate" , "I want to learn this kind of shot! Teach me. " ,
96+ "This shot has navigated right into my heart." ,
97+ "Immensely thought out! Excellent shot! Ahhhhhhh..." ,
98+ "Nice use of light in this style dude, and Those icons blew my mind." ,
99+ "Button, gradient, boldness, texture – excellent =)" ,
100+ "Sky blue. I wonder what would have happened if I made this" ,
101+ "This work has navigated right into my heart." ,
102+ "Engaging. It keeps your mind occupied while you wait." ,
103+ "Background, hero, experience, colour – incredible :-)" ,
104+ "Very thought out! I wonder what would have happened if I made this" ,
105+ "Strong mate I approve the use of layout and lines!" , "This is magical work :)" ,
106+ "Classic animation! Just delightful!" , "Nice use of magenta in this shapes!!"
107+ };
108+ private static String [] postedTime = {
109+ "Yesterday" , "12 hours ago" , "5 hours ago" , "2 hours ago" , "1 hour ago" , "5 minutes ago" ,
110+ "2 minutes ago" , "1 minute ago" , "Just now"
111+ };
72112 private final Random random = new Random ();
73113
74114 public List <FaqItem > getAccountFaq () {
@@ -81,6 +121,15 @@ public List<FaqItem> getAccountFaq() {
81121 return items ;
82122 }
83123
124+ public List <Person > getCast () {
125+ List <Person > items = new ArrayList <>(cast .length );
126+ int i = 0 ;
127+ for (String name : cast ) {
128+ items .add (new Person (name , name .substring (0 , 1 ), castOverline [i ++]));
129+ }
130+ return items ;
131+ }
132+
84133 public List <ColoredItem > getColoredItems (int count ) {
85134 List <ColoredItem > coloredItems = new ArrayList <>(count );
86135 for (int i = 1 ; i <= count ; i ++) {
@@ -89,6 +138,20 @@ public List<ColoredItem> getColoredItems(int count) {
89138 return coloredItems ;
90139 }
91140
141+ public List <Comment > getComments () {
142+ int totalComments = random .nextInt (10 ) + 2 ;
143+ return generateComment (totalComments , 0 );
144+ }
145+
146+ public List <Person > getCrew () {
147+ List <Person > items = new ArrayList <>(crew .length );
148+ int i = 0 ;
149+ for (String name : crew ) {
150+ items .add (new Person (name , name .substring (0 , 1 ), crewOverline [i ++]));
151+ }
152+ return items ;
153+ }
154+
92155 public List <SelectableItem > getLanguages () {
93156 List <SelectableItem > items = new ArrayList <>(languages .length );
94157 for (String language : languages ) {
@@ -106,22 +169,14 @@ public List<FaqItem> getMiscFaq() {
106169 return items ;
107170 }
108171
109- public List <MoviePosterItem > getMovies () {
110- List <MoviePosterItem > textItems = new ArrayList <>(movieNames .length );
111- for (String movieName : movieNames ) {
112- textItems .add (new MoviePosterItem (movieName , newsColorsList [random .nextInt (9 )]));
113- }
114- return textItems ;
115- }
116-
117172 public List <NewsItem > getNewsList (boolean isOffline ) {
118173 List <NewsItem > numberItems = new ArrayList <>(5 );
119174 for (int i = 0 ; i < 5 ; i ++) {
120175 int newsSource = random .nextInt (2 );
121176 numberItems .add (new NewsItem (i , newsSource == 0 ? "Umbrella News" : "Fake News" ,
122177 newsSource == 0 ? R .drawable .ic_umbrella : R .drawable .ic_fake_news ,
123178 Color .parseColor (newsSource == 0 ? "#01CC9D" : "#FE1743" ),
124- newsThumbnails [random .nextInt (2 )], newsColorsList [random .nextInt (9 )], newsDummyTitles [i ],
179+ newsThumbnails [random .nextInt (3 )], newsColorsList [random .nextInt (9 )], newsDummyTitles [i ],
125180 "14-July-2018" , isOffline ));
126181 }
127182 return numberItems ;
@@ -158,6 +213,15 @@ public List<FaqItem> getPaymentFaq() {
158213 return items ;
159214 }
160215
216+ public List <Person > getProducers () {
217+ List <Person > items = new ArrayList <>(producer .length );
218+ int i = 0 ;
219+ for (String name : producer ) {
220+ items .add (new Person (name , name .substring (0 , 1 ), producerOverline [i ++]));
221+ }
222+ return items ;
223+ }
224+
161225 public List <SelectableItem > getTelevisionChannels () {
162226 List <SelectableItem > items = new ArrayList <>(televisions .length );
163227 for (String channel : televisions ) {
@@ -189,4 +253,20 @@ public List<SelectableItem> getWebsites() {
189253 }
190254 return items ;
191255 }
256+
257+ private List <Comment > generateComment (int count , int level ) {
258+ if (level > 7 ) {
259+ return new ArrayList <>();
260+ }
261+ List <Comment > comments = new ArrayList <>();
262+ for (int i = 0 ; i < count ; i ++) {
263+ comments .add (generateComment (level ));
264+ }
265+ return comments ;
266+ }
267+
268+ private Comment generateComment (int level ) {
269+ return new Comment (authors [random .nextInt (8 )], comments [random .nextInt (20 )],
270+ postedTime [random .nextInt (2 ) + level ], generateComment (random .nextInt (5 ), level + 1 ));
271+ }
192272}
0 commit comments