Skip to content

Commit ed6e2b6

Browse files
authored
Merge pull request #52 from RamolaWeb/master
Finished First Version
2 parents 3c95886 + eedd585 commit ed6e2b6

36 files changed

+233
-128
lines changed

app/build.gradle

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,8 @@ dependencies {
3838
compile 'com.onesignal:OneSignal:3.+@aar'
3939
compile "com.google.android.gms:play-services-gcm:10.2.0"
4040
compile 'com.google.android.gms:play-services-maps:10.2.0'
41-
compile 'de.hdodenhof:circleimageview:1.3.0'
4241
compile 'com.android.support:support-v4:25.1.0'
4342
compile 'com.github.jd-alexander:LikeButton:0.2.0'
4443
compile 'com.cloudinary:cloudinary-android:1.2.2'
4544
compile 'com.android.support:palette-v7:25.0.1'
46-
47-
compile 'net.steamcrafted:load-toast:1.0.10'
48-
compile 'com.squareup.okhttp3:logging-interceptor:3.2.0'
49-
compile 'com.github.florent37:materialleanback:1.0.2'
50-
compile 'com.nineoldandroids:library:2.4.0'
5145
}

app/src/main/AndroidManifest.xml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<application
1515
android:name=".Utils.MyApplication"
1616
android:allowBackup="true"
17-
android:icon="@drawable/logo_b_t"
17+
android:icon="@drawable/nimbuslogo"
1818
android:label="@string/app_name"
1919
android:supportsRtl="true"
2020
android:theme="@style/AppTheme">
@@ -47,7 +47,11 @@
4747
<activity android:name=".Activity.TeamEventActivity" />
4848
<activity
4949
android:name=".Activity.NewsFeedActivity"
50-
android:theme="@style/AppTheme.NoActionBar" />
50+
android:theme="@style/AppTheme.NoActionBar" >
51+
<meta-data
52+
android:name="android.support.PARENT_ACTIVITY"
53+
android:value="com.nith.appteam.nimbus.Activity.MainActivity" />
54+
</activity>
5155
<activity
5256
android:name=".Activity.MainActivity"
5357
android:theme="@style/HomeTheme" />
@@ -127,12 +131,20 @@
127131
<activity android:name=".Activity.MapActivity" />
128132
<activity
129133
android:name=".Activity.QuizActivity"
130-
android:theme="@style/AppTheme.NoActionBar" />
134+
android:theme="@style/AppTheme.NoActionBar" >
135+
<meta-data
136+
android:name="android.support.PARENT_ACTIVITY"
137+
android:value="com.nith.appteam.nimbus.Activity.MainActivity" />
138+
</activity>
131139

132140
<activity
133141
android:name=".Activity.AboutActivity"
134142
android:label="@string/title_activity_about"
135-
android:theme="@style/AppTheme"></activity>
143+
android:theme="@style/AppTheme.NoActionBar">
144+
<meta-data
145+
android:name="android.support.PARENT_ACTIVITY"
146+
android:value="com.nith.appteam.nimbus.Activity.MainActivity" />
147+
</activity>
136148

137149
<activity android:name=".Activity.GalleryDetailActivity" />
138150
<activity android:name=".Activity.GalleryActivity" >
@@ -141,7 +153,11 @@
141153
android:value="com.nith.appteam.nimbus.Activity.MainActivity" />
142154
</activity>
143155

144-
<activity android:name=".Notification.NotificationActivity"></activity>
156+
<activity android:name=".Notification.NotificationActivity">
157+
<meta-data
158+
android:name="android.support.PARENT_ACTIVITY"
159+
android:value="com.nith.appteam.nimbus.Activity.MainActivity" />
160+
</activity>
145161

146162
<activity android:name=".Notification.Notification2"
147163
android:parentActivityName=".Notification.NotificationActivity"/>

app/src/main/java/com/nith/appteam/nimbus/Activity/AboutActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class AboutActivity extends AppCompatActivity {
2222
@Override
2323
protected void onCreate(Bundle savedInstanceState) {
2424
super.onCreate(savedInstanceState);
25-
setContentView(R.layout.activity_about);
25+
setContentView(R.layout.content_about);
2626
initCollapsingToolbar();
2727
toolbar = (Toolbar) findViewById(R.id.toolbar);
2828
setSupportActionBar(toolbar);

app/src/main/java/com/nith/appteam/nimbus/Activity/MainActivity.java

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ public class MainActivity extends AppCompatActivity {
5454
private ImageView imgNavHeaderBg, imgProfile;
5555
private TextView txtName, txtSubName;
5656
Toolbar toolbar;
57-
private LinearLayout quiz_layout, gallery_layout,
58-
map_layout, newsfeed_layout, coreteam_layout ,
59-
aboutnimbus_layout , teams_layout, feedback_layout;
57+
private LinearLayout quiz_layout, gallery_layout, map_layout, newsfeed_layout, coreteam_layout , aboutnimbus_layout , teams_layout, feedback_layout,sponsor_layout,workshop_layout,contributor_layout;
6058

6159
//public static int navItemIndex = 0;
6260

@@ -139,7 +137,9 @@ public void init(){
139137
aboutnimbus_layout= (LinearLayout) findViewById(R.id.aboutnimbus_layout);
140138
teams_layout= (LinearLayout) findViewById(R.id.teams_layout);
141139
feedback_layout= (LinearLayout) findViewById(R.id.feedback_layout);
142-
140+
contributor_layout= (LinearLayout) findViewById(R.id.contributor_layout);
141+
sponsor_layout= (LinearLayout) findViewById(R.id.sponsor_layout);
142+
workshop_layout= (LinearLayout) findViewById(R.id.workshop_layout);
143143
bottomNavigationView= (BottomNavigationView) findViewById(R.id.bottom_navigation);
144144

145145
}
@@ -155,14 +155,14 @@ public void onClick(View v) {
155155
gallery_layout.setOnClickListener(new View.OnClickListener() {
156156
@Override
157157
public void onClick(View v) {
158-
158+
startActivity(new Intent(MainActivity.this,GalleryActivity.class));
159159
}
160160
});
161161

162162
map_layout.setOnClickListener(new View.OnClickListener() {
163163
@Override
164164
public void onClick(View v) {
165-
165+
startActivity(new Intent(MainActivity.this,MapActivity.class));
166166
}
167167
});
168168

@@ -176,28 +176,53 @@ public void onClick(View v) {
176176
coreteam_layout.setOnClickListener(new View.OnClickListener() {
177177
@Override
178178
public void onClick(View v) {
179-
startActivity(new Intent(MainActivity.this,TeamActivity.class));
179+
startActivity(new Intent(MainActivity.this,CoreTeamActivity.class));
180180
}
181181
});
182182

183183
aboutnimbus_layout.setOnClickListener(new View.OnClickListener() {
184184
@Override
185185
public void onClick(View v) {
186-
186+
startActivity(new Intent(MainActivity.this,AboutActivity.class));
187187
}
188188
});
189189

190190
teams_layout.setOnClickListener(new View.OnClickListener() {
191191
@Override
192192
public void onClick(View v) {
193-
193+
startActivity(new Intent(MainActivity.this,TeamActivity.class));
194194
}
195195
});
196196

197197
feedback_layout.setOnClickListener(new View.OnClickListener() {
198198
@Override
199199
public void onClick(View v) {
200+
Intent intent = new Intent(Intent.ACTION_SENDTO);
201+
String uriText = "mailto:" + Uri.encode("appteam.nith@gmail.com") + "?subject=" + Uri.encode("Reporting A Bug/Feedback") + "&body=" + Uri.encode("Hello, \nI want to report a bug/give feedback corresponding to the app Nimbus App.\n.....\n\n-Your name");
202+
Uri uri = Uri.parse(uriText);
203+
intent.setData(uri);
204+
startActivity(Intent.createChooser(intent, "Send Email"));
205+
}
206+
});
200207

208+
workshop_layout.setOnClickListener(new View.OnClickListener() {
209+
@Override
210+
public void onClick(View v) {
211+
startActivity(new Intent(MainActivity.this,Workshops.class));
212+
}
213+
});
214+
215+
sponsor_layout.setOnClickListener(new View.OnClickListener() {
216+
@Override
217+
public void onClick(View v) {
218+
startActivity(new Intent(MainActivity.this,SponsorActivity.class));
219+
}
220+
});
221+
222+
contributor_layout.setOnClickListener(new View.OnClickListener() {
223+
@Override
224+
public void onClick(View v) {
225+
startActivity(new Intent(MainActivity.this,ContributorsActivity.class));
201226
}
202227
});
203228

@@ -278,11 +303,6 @@ public boolean onNavigationItemSelected(MenuItem menuItem) {
278303
alertDialog.show();
279304
drawer.closeDrawers();
280305
return true;
281-
case R.id.nav_settings:
282-
//navItemIndex = 2;
283-
//startActivity(new Intent(MainActivity.this, XYZ.class));
284-
drawer.closeDrawers();
285-
return true;
286306
case R.id.nav_team:
287307
startActivity(new Intent(MainActivity.this, ContributorsActivity.class));
288308
drawer.closeDrawers();

app/src/main/java/com/nith/appteam/nimbus/Activity/NewsFeedActivity.java

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
import android.content.Intent;
44
import android.os.Bundle;
5+
import android.support.design.widget.CoordinatorLayout;
56
import android.support.design.widget.FloatingActionButton;
7+
import android.support.design.widget.Snackbar;
68
import android.support.v4.text.TextDirectionHeuristicCompat;
79
import android.support.v4.widget.SwipeRefreshLayout;
810
import android.support.v7.app.ActionBar;
@@ -36,8 +38,6 @@
3638
public class NewsFeedActivity extends AppCompatActivity implements SwipeRefreshLayout.OnRefreshListener{
3739

3840
private static final String FEED_LIST ="list" ;
39-
private TextView tv;
40-
private TextView des;
4141
private RecyclerView recyclerView;
4242
private NewsFeedAdapter adapter;
4343
private ProgressBar progressBar;
@@ -46,21 +46,22 @@ public class NewsFeedActivity extends AppCompatActivity implements SwipeRefreshL
4646
private int pastVisiblesItems, visibleItemCount, totalItemCount, previousTotal = 0, visibleThreshold = 0,feedNo=1;
4747
private ArrayList<NewsFeed> list=new ArrayList<>();
4848
private SharedPref pref;
49+
private CoordinatorLayout coordinatorLayout;
4950

5051
@Override
5152
protected void onCreate(Bundle savedInstanceState) {
5253
pref= new SharedPref(this);
5354
super.onCreate(savedInstanceState);
5455

5556
setContentView(R.layout.newsfeed);
57+
coordinatorLayout= (CoordinatorLayout) findViewById(R.id.core_view);
5658
swipeRefreshLayout= (SwipeRefreshLayout) findViewById(R.id.swipeRefresh);
5759
swipeRefreshLayout.setOnRefreshListener(this);
5860
Toolbar toolbar = (Toolbar) findViewById(R.id.my_toolbar);
5961
progressBar= (ProgressBar) findViewById(R.id.progress);
6062
setSupportActionBar(toolbar);
6163
ActionBar ab = getSupportActionBar();
62-
tv = (TextView)findViewById(R.id.user_name);
63-
des = (TextView) findViewById(R.id.user_msg);
64+
6465
// Enable the Up button
6566
ab.setDisplayHomeAsUpEnabled(true);
6667
recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
@@ -96,8 +97,18 @@ public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
9697
});
9798

9899

99-
if(savedInstanceState==null)
100-
showData(1);
100+
if(savedInstanceState==null){
101+
if(pref.getUserId().isEmpty()){
102+
progressBar.setVisibility(View.GONE);
103+
Snackbar.make(coordinatorLayout,"Please Login To See The Content",Snackbar.LENGTH_INDEFINITE).setAction("Login", new View.OnClickListener() {
104+
@Override
105+
public void onClick(View v) {
106+
startActivity(new Intent(NewsFeedActivity.this,LoginActivity.class));
107+
}
108+
}).show();
109+
}
110+
else
111+
showData(1);}
101112
else {
102113

103114
list=savedInstanceState.getParcelableArrayList(FEED_LIST);
@@ -179,7 +190,13 @@ public void onResponse(Call<NewsFeedResponse> call, Response<NewsFeedResponse> r
179190
}
180191

181192

182-
Toast.makeText(NewsFeedActivity.this,"Unable to fetch Data",Toast.LENGTH_SHORT).show();
193+
Snackbar.make(coordinatorLayout,"Unable To load Data",Snackbar.LENGTH_INDEFINITE).setAction("Reload", new View.OnClickListener() {
194+
@Override
195+
public void onClick(View v) {
196+
progressBar.setVisibility(View.VISIBLE);
197+
showData(1);
198+
}
199+
}).show();
183200
}
184201
}
185202

app/src/main/java/com/nith/appteam/nimbus/Activity/QuizQuestionActivity.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,14 @@ public void onClick(View view) {
8080
SharedPref pref=new SharedPref(this);
8181
String userId=pref.getUserId();
8282

83+
if(!userId.isEmpty()){
8384
loadQuizwithRetrofit(userId);
85+
t=new timer(this,time_left);}
86+
else {
87+
message.setText("Please Login to Play Quiz ");
88+
}
89+
8490

85-
t=new timer(this,time_left);
8691

8792
}
8893

app/src/main/java/com/nith/appteam/nimbus/Activity/TeamEventActivity.java

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
package com.nith.appteam.nimbus.Activity;
22

33
import android.content.Intent;
4+
import android.graphics.Bitmap;
45
import android.graphics.Color;
56
import android.os.Bundle;
67
import android.support.design.widget.AppBarLayout;
8+
import android.support.v4.graphics.drawable.RoundedBitmapDrawable;
9+
import android.support.v4.graphics.drawable.RoundedBitmapDrawableFactory;
710
import android.support.v7.app.AppCompatActivity;
811
import android.support.v7.widget.CardView;
912
import android.support.v7.widget.LinearLayoutManager;
1013
import android.support.v7.widget.RecyclerView;
1114
import android.support.v7.widget.Toolbar;
15+
import android.util.Log;
1216
import android.view.View;
1317
import android.view.animation.AlphaAnimation;
1418
import android.widget.ImageView;
@@ -19,6 +23,8 @@
1923
import com.bumptech.glide.Glide;
2024
import com.bumptech.glide.load.engine.DiskCacheStrategy;
2125

26+
import com.bumptech.glide.load.resource.drawable.GlideDrawable;
27+
import com.bumptech.glide.request.target.ImageViewTarget;
2228
import com.nith.appteam.nimbus.Adapter.EventAdapter;
2329
import com.nith.appteam.nimbus.Adapter.ProjectAdapter;
2430
import com.nith.appteam.nimbus.Fragment.TeamFragment;
@@ -34,6 +40,8 @@
3440
import retrofit2.Callback;
3541
import retrofit2.Response;
3642

43+
import static android.R.attr.resource;
44+
3745
public class TeamEventActivity extends AppCompatActivity implements AppBarLayout.OnOffsetChangedListener {
3846

3947
private static final float PERCENTAGE_TO_SHOW_TITLE_AT_TOOLBAR = 0.9f;
@@ -45,7 +53,8 @@ public class TeamEventActivity extends AppCompatActivity implements AppBarLayout
4553
private TextView mTitle,teamDescription,headerTitle;
4654
private AppBarLayout mAppBarLayout;
4755
private Toolbar mToolbar;
48-
private ImageView bannerImage,logoImage;
56+
private ImageView bannerImage;
57+
private ImageView logoView;
4958
private RecyclerView eventList;
5059
private EventAdapter adapter;
5160
private RecyclerView projectList;
@@ -88,7 +97,16 @@ protected void onCreate(Bundle savedInstanceState) {
8897
teamDescription= (TextView) findViewById(R.id.teamDescription);
8998
headerTitle= (TextView) findViewById(R.id.header_title_team);
9099
bannerImage= (ImageView) findViewById(R.id.main_imageview_placeholder);
91-
logoImage= (ImageView) findViewById(R.id.teamlogo);
100+
logoView= (ImageView) findViewById(R.id.teamlogo);
101+
Glide.with(TeamEventActivity.this).load(R.drawable.nimbuslogo).asBitmap().diskCacheStrategy(DiskCacheStrategy.ALL).error(R.drawable.w1).into(new ImageViewTarget<Bitmap>(logoView) {
102+
@Override
103+
protected void setResource(Bitmap resource) {
104+
RoundedBitmapDrawable drawable= RoundedBitmapDrawableFactory.create(TeamEventActivity.this.getResources(),resource);
105+
drawable.setCircular(true);
106+
logoView.setImageDrawable(drawable);
107+
}
108+
});
109+
92110

93111
eventList= (RecyclerView) findViewById(R.id.eventList);
94112
eventList.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,true));
@@ -113,7 +131,7 @@ public void onItemClick(View view, int position) {
113131
projectList.addOnItemTouchListener(new RecyclerItemClickListener(this, new RecyclerItemClickListener.OnItemClickListener() {
114132
@Override
115133
public void onItemClick(View view, int position) {
116-
Intent i=new Intent(TeamEventActivity.this,WorkshopDetail.class);
134+
// Intent i=new Intent(TeamEventActivity.this,WorkshopDetail.class);
117135
// i.putExtra(ACTIVITY,EVENT);
118136
// i.putExtra(EVENT_NAME,eventArrayList.get(position).getName());
119137
// i.putExtra(ID,eventArrayList.get(position).getId());
@@ -200,8 +218,16 @@ public void onResponse(Call<TeamEventList> call, Response<TeamEventList> respons
200218
mTitle.setText(t.getName());
201219
headerTitle.setText(t.getName());
202220
teamDescription.setText(t.getDesc());
221+
Log.d("g",t.getLogo());
203222
Glide.with(TeamEventActivity.this).load(t.getBanner()).diskCacheStrategy(DiskCacheStrategy.ALL).placeholder(R.drawable.nimbuslogo).into(bannerImage);
204-
Glide.with(TeamEventActivity.this).load(t.getBanner()).diskCacheStrategy(DiskCacheStrategy.ALL).placeholder(R.drawable.nimbuslogo).into(logoImage);
223+
Glide.with(TeamEventActivity.this).load(t.getLogo()).asBitmap().diskCacheStrategy(DiskCacheStrategy.ALL).error(R.drawable.w1).into(new ImageViewTarget<Bitmap>(logoView) {
224+
@Override
225+
protected void setResource(Bitmap resource) {
226+
RoundedBitmapDrawable drawable= RoundedBitmapDrawableFactory.create(TeamEventActivity.this.getResources(),resource);
227+
drawable.setCircular(true);
228+
logoView.setImageDrawable(drawable);
229+
}
230+
});
205231
CardView card=(CardView)findViewById(R.id.card_desc);
206232
TextView eventlabel=(TextView)findViewById(R.id.eventslabel);
207233
TextView projectslabel=(TextView)findViewById(R.id.eventslabel);

app/src/main/java/com/nith/appteam/nimbus/Activity/UploadNewsFeedActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void onClick(View view) {
8484
i.putExtra(UPLOAD_SERVICE,true);
8585
i.putExtra(TITLE,add.title);
8686
i.putExtra(DESCRIPTION,add.detail);
87-
87+
if(!imageUrl.toString().isEmpty())
8888
i.putExtra(URL_IMAGE,imageUrl.toString());
8989
startService(i);
9090

app/src/main/java/com/nith/appteam/nimbus/Adapter/NewsFeedAdapter.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,6 @@ public void onClick(View v) {
139139

140140
if(card.getPhoto()!=null&&!card.getPhoto().isEmpty())
141141
Glide.with(mContext).load(card.getPhoto()).into(h.post_img);
142-
else
143-
h.post_img.setImageResource(R.drawable.team);
144142
Log.v("stwtus",""+card.isStatus());
145143
if(card.isStatus())
146144
h.lyk_status.setLiked(true);

0 commit comments

Comments
 (0)