Skip to content

Commit

Permalink
Merge pull request #52 from RamolaWeb/master
Browse files Browse the repository at this point in the history
Finished First Version
  • Loading branch information
RamolaWeb authored Mar 13, 2017
2 parents 3c95886 + eedd585 commit ed6e2b6
Show file tree
Hide file tree
Showing 36 changed files with 233 additions and 128 deletions.
6 changes: 0 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,8 @@ dependencies {
compile 'com.onesignal:OneSignal:3.+@aar'
compile "com.google.android.gms:play-services-gcm:10.2.0"
compile 'com.google.android.gms:play-services-maps:10.2.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.android.support:support-v4:25.1.0'
compile 'com.github.jd-alexander:LikeButton:0.2.0'
compile 'com.cloudinary:cloudinary-android:1.2.2'
compile 'com.android.support:palette-v7:25.0.1'

compile 'net.steamcrafted:load-toast:1.0.10'
compile 'com.squareup.okhttp3:logging-interceptor:3.2.0'
compile 'com.github.florent37:materialleanback:1.0.2'
compile 'com.nineoldandroids:library:2.4.0'
}
26 changes: 21 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<application
android:name=".Utils.MyApplication"
android:allowBackup="true"
android:icon="@drawable/logo_b_t"
android:icon="@drawable/nimbuslogo"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
Expand Down Expand Up @@ -47,7 +47,11 @@
<activity android:name=".Activity.TeamEventActivity" />
<activity
android:name=".Activity.NewsFeedActivity"
android:theme="@style/AppTheme.NoActionBar" />
android:theme="@style/AppTheme.NoActionBar" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.nith.appteam.nimbus.Activity.MainActivity" />
</activity>
<activity
android:name=".Activity.MainActivity"
android:theme="@style/HomeTheme" />
Expand Down Expand Up @@ -127,12 +131,20 @@
<activity android:name=".Activity.MapActivity" />
<activity
android:name=".Activity.QuizActivity"
android:theme="@style/AppTheme.NoActionBar" />
android:theme="@style/AppTheme.NoActionBar" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.nith.appteam.nimbus.Activity.MainActivity" />
</activity>

<activity
android:name=".Activity.AboutActivity"
android:label="@string/title_activity_about"
android:theme="@style/AppTheme"></activity>
android:theme="@style/AppTheme.NoActionBar">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.nith.appteam.nimbus.Activity.MainActivity" />
</activity>

<activity android:name=".Activity.GalleryDetailActivity" />
<activity android:name=".Activity.GalleryActivity" >
Expand All @@ -141,7 +153,11 @@
android:value="com.nith.appteam.nimbus.Activity.MainActivity" />
</activity>

<activity android:name=".Notification.NotificationActivity"></activity>
<activity android:name=".Notification.NotificationActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.nith.appteam.nimbus.Activity.MainActivity" />
</activity>

<activity android:name=".Notification.Notification2"
android:parentActivityName=".Notification.NotificationActivity"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class AboutActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
setContentView(R.layout.content_about);
initCollapsingToolbar();
toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ public class MainActivity extends AppCompatActivity {
private ImageView imgNavHeaderBg, imgProfile;
private TextView txtName, txtSubName;
Toolbar toolbar;
private LinearLayout quiz_layout, gallery_layout,
map_layout, newsfeed_layout, coreteam_layout ,
aboutnimbus_layout , teams_layout, feedback_layout;
private LinearLayout quiz_layout, gallery_layout, map_layout, newsfeed_layout, coreteam_layout , aboutnimbus_layout , teams_layout, feedback_layout,sponsor_layout,workshop_layout,contributor_layout;

//public static int navItemIndex = 0;

Expand Down Expand Up @@ -139,7 +137,9 @@ public void init(){
aboutnimbus_layout= (LinearLayout) findViewById(R.id.aboutnimbus_layout);
teams_layout= (LinearLayout) findViewById(R.id.teams_layout);
feedback_layout= (LinearLayout) findViewById(R.id.feedback_layout);

contributor_layout= (LinearLayout) findViewById(R.id.contributor_layout);
sponsor_layout= (LinearLayout) findViewById(R.id.sponsor_layout);
workshop_layout= (LinearLayout) findViewById(R.id.workshop_layout);
bottomNavigationView= (BottomNavigationView) findViewById(R.id.bottom_navigation);

}
Expand All @@ -155,14 +155,14 @@ public void onClick(View v) {
gallery_layout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

startActivity(new Intent(MainActivity.this,GalleryActivity.class));
}
});

map_layout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

startActivity(new Intent(MainActivity.this,MapActivity.class));
}
});

Expand All @@ -176,28 +176,53 @@ public void onClick(View v) {
coreteam_layout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(MainActivity.this,TeamActivity.class));
startActivity(new Intent(MainActivity.this,CoreTeamActivity.class));
}
});

aboutnimbus_layout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

startActivity(new Intent(MainActivity.this,AboutActivity.class));
}
});

teams_layout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

startActivity(new Intent(MainActivity.this,TeamActivity.class));
}
});

feedback_layout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_SENDTO);
String uriText = "mailto:" + Uri.encode("[email protected]") + "?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");
Uri uri = Uri.parse(uriText);
intent.setData(uri);
startActivity(Intent.createChooser(intent, "Send Email"));
}
});

workshop_layout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(MainActivity.this,Workshops.class));
}
});

sponsor_layout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(MainActivity.this,SponsorActivity.class));
}
});

contributor_layout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(MainActivity.this,ContributorsActivity.class));
}
});

Expand Down Expand Up @@ -278,11 +303,6 @@ public boolean onNavigationItemSelected(MenuItem menuItem) {
alertDialog.show();
drawer.closeDrawers();
return true;
case R.id.nav_settings:
//navItemIndex = 2;
//startActivity(new Intent(MainActivity.this, XYZ.class));
drawer.closeDrawers();
return true;
case R.id.nav_team:
startActivity(new Intent(MainActivity.this, ContributorsActivity.class));
drawer.closeDrawers();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v4.text.TextDirectionHeuristicCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.ActionBar;
Expand Down Expand Up @@ -36,8 +38,6 @@
public class NewsFeedActivity extends AppCompatActivity implements SwipeRefreshLayout.OnRefreshListener{

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

@Override
protected void onCreate(Bundle savedInstanceState) {
pref= new SharedPref(this);
super.onCreate(savedInstanceState);

setContentView(R.layout.newsfeed);
coordinatorLayout= (CoordinatorLayout) findViewById(R.id.core_view);
swipeRefreshLayout= (SwipeRefreshLayout) findViewById(R.id.swipeRefresh);
swipeRefreshLayout.setOnRefreshListener(this);
Toolbar toolbar = (Toolbar) findViewById(R.id.my_toolbar);
progressBar= (ProgressBar) findViewById(R.id.progress);
setSupportActionBar(toolbar);
ActionBar ab = getSupportActionBar();
tv = (TextView)findViewById(R.id.user_name);
des = (TextView) findViewById(R.id.user_msg);

// Enable the Up button
ab.setDisplayHomeAsUpEnabled(true);
recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
Expand Down Expand Up @@ -96,8 +97,18 @@ public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
});


if(savedInstanceState==null)
showData(1);
if(savedInstanceState==null){
if(pref.getUserId().isEmpty()){
progressBar.setVisibility(View.GONE);
Snackbar.make(coordinatorLayout,"Please Login To See The Content",Snackbar.LENGTH_INDEFINITE).setAction("Login", new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(NewsFeedActivity.this,LoginActivity.class));
}
}).show();
}
else
showData(1);}
else {

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


Toast.makeText(NewsFeedActivity.this,"Unable to fetch Data",Toast.LENGTH_SHORT).show();
Snackbar.make(coordinatorLayout,"Unable To load Data",Snackbar.LENGTH_INDEFINITE).setAction("Reload", new View.OnClickListener() {
@Override
public void onClick(View v) {
progressBar.setVisibility(View.VISIBLE);
showData(1);
}
}).show();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,14 @@ public void onClick(View view) {
SharedPref pref=new SharedPref(this);
String userId=pref.getUserId();

if(!userId.isEmpty()){
loadQuizwithRetrofit(userId);
t=new timer(this,time_left);}
else {
message.setText("Please Login to Play Quiz ");
}


t=new timer(this,time_left);

}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
package com.nith.appteam.nimbus.Activity;

import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.os.Bundle;
import android.support.design.widget.AppBarLayout;
import android.support.v4.graphics.drawable.RoundedBitmapDrawable;
import android.support.v4.graphics.drawable.RoundedBitmapDrawableFactory;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.CardView;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.widget.ImageView;
Expand All @@ -19,6 +23,8 @@
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;

import com.bumptech.glide.load.resource.drawable.GlideDrawable;
import com.bumptech.glide.request.target.ImageViewTarget;
import com.nith.appteam.nimbus.Adapter.EventAdapter;
import com.nith.appteam.nimbus.Adapter.ProjectAdapter;
import com.nith.appteam.nimbus.Fragment.TeamFragment;
Expand All @@ -34,6 +40,8 @@
import retrofit2.Callback;
import retrofit2.Response;

import static android.R.attr.resource;

public class TeamEventActivity extends AppCompatActivity implements AppBarLayout.OnOffsetChangedListener {

private static final float PERCENTAGE_TO_SHOW_TITLE_AT_TOOLBAR = 0.9f;
Expand All @@ -45,7 +53,8 @@ public class TeamEventActivity extends AppCompatActivity implements AppBarLayout
private TextView mTitle,teamDescription,headerTitle;
private AppBarLayout mAppBarLayout;
private Toolbar mToolbar;
private ImageView bannerImage,logoImage;
private ImageView bannerImage;
private ImageView logoView;
private RecyclerView eventList;
private EventAdapter adapter;
private RecyclerView projectList;
Expand Down Expand Up @@ -88,7 +97,16 @@ protected void onCreate(Bundle savedInstanceState) {
teamDescription= (TextView) findViewById(R.id.teamDescription);
headerTitle= (TextView) findViewById(R.id.header_title_team);
bannerImage= (ImageView) findViewById(R.id.main_imageview_placeholder);
logoImage= (ImageView) findViewById(R.id.teamlogo);
logoView= (ImageView) findViewById(R.id.teamlogo);
Glide.with(TeamEventActivity.this).load(R.drawable.nimbuslogo).asBitmap().diskCacheStrategy(DiskCacheStrategy.ALL).error(R.drawable.w1).into(new ImageViewTarget<Bitmap>(logoView) {
@Override
protected void setResource(Bitmap resource) {
RoundedBitmapDrawable drawable= RoundedBitmapDrawableFactory.create(TeamEventActivity.this.getResources(),resource);
drawable.setCircular(true);
logoView.setImageDrawable(drawable);
}
});


eventList= (RecyclerView) findViewById(R.id.eventList);
eventList.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,true));
Expand All @@ -113,7 +131,7 @@ public void onItemClick(View view, int position) {
projectList.addOnItemTouchListener(new RecyclerItemClickListener(this, new RecyclerItemClickListener.OnItemClickListener() {
@Override
public void onItemClick(View view, int position) {
Intent i=new Intent(TeamEventActivity.this,WorkshopDetail.class);
// Intent i=new Intent(TeamEventActivity.this,WorkshopDetail.class);
// i.putExtra(ACTIVITY,EVENT);
// i.putExtra(EVENT_NAME,eventArrayList.get(position).getName());
// i.putExtra(ID,eventArrayList.get(position).getId());
Expand Down Expand Up @@ -200,8 +218,16 @@ public void onResponse(Call<TeamEventList> call, Response<TeamEventList> respons
mTitle.setText(t.getName());
headerTitle.setText(t.getName());
teamDescription.setText(t.getDesc());
Log.d("g",t.getLogo());
Glide.with(TeamEventActivity.this).load(t.getBanner()).diskCacheStrategy(DiskCacheStrategy.ALL).placeholder(R.drawable.nimbuslogo).into(bannerImage);
Glide.with(TeamEventActivity.this).load(t.getBanner()).diskCacheStrategy(DiskCacheStrategy.ALL).placeholder(R.drawable.nimbuslogo).into(logoImage);
Glide.with(TeamEventActivity.this).load(t.getLogo()).asBitmap().diskCacheStrategy(DiskCacheStrategy.ALL).error(R.drawable.w1).into(new ImageViewTarget<Bitmap>(logoView) {
@Override
protected void setResource(Bitmap resource) {
RoundedBitmapDrawable drawable= RoundedBitmapDrawableFactory.create(TeamEventActivity.this.getResources(),resource);
drawable.setCircular(true);
logoView.setImageDrawable(drawable);
}
});
CardView card=(CardView)findViewById(R.id.card_desc);
TextView eventlabel=(TextView)findViewById(R.id.eventslabel);
TextView projectslabel=(TextView)findViewById(R.id.eventslabel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void onClick(View view) {
i.putExtra(UPLOAD_SERVICE,true);
i.putExtra(TITLE,add.title);
i.putExtra(DESCRIPTION,add.detail);

if(!imageUrl.toString().isEmpty())
i.putExtra(URL_IMAGE,imageUrl.toString());
startService(i);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ public void onClick(View v) {

if(card.getPhoto()!=null&&!card.getPhoto().isEmpty())
Glide.with(mContext).load(card.getPhoto()).into(h.post_img);
else
h.post_img.setImageResource(R.drawable.team);
Log.v("stwtus",""+card.isStatus());
if(card.isStatus())
h.lyk_status.setLiked(true);
Expand Down
Loading

0 comments on commit ed6e2b6

Please sign in to comment.