-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
31 changed files
with
437 additions
and
362 deletions.
There are no files selected for viewing
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
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 was deleted.
Oops, something went wrong.
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,80 @@ | ||
package com.neosoft.neostore.ui; | ||
|
||
import android.graphics.Color; | ||
import android.os.Bundle; | ||
import android.support.annotation.NonNull; | ||
import android.support.design.widget.NavigationView; | ||
import android.support.v4.app.Fragment; | ||
import android.support.v4.view.GravityCompat; | ||
import android.support.v4.view.MenuItemCompat; | ||
import android.support.v4.view.ViewPager; | ||
import android.support.v4.widget.DrawerLayout; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.view.Gravity; | ||
import android.view.MenuItem; | ||
import android.widget.LinearLayout; | ||
import android.widget.TextView; | ||
|
||
import com.neosoft.neostore.R; | ||
import com.neosoft.neostore.adapter.HomepageAdapter; | ||
import com.neosoft.neostore.fragment.HomepageFragment; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import me.relex.circleindicator.CircleIndicator; | ||
|
||
public class HomeScreen extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener { | ||
TextView mycart; | ||
LinearLayout badge_layout; | ||
|
||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_drawer); | ||
NavigationView navigationView = (NavigationView) findViewById(R.id.navlayout); | ||
navigationView.setNavigationItemSelectedListener(this); | ||
badge_layout = (LinearLayout) MenuItemCompat.getActionView(navigationView.getMenu().findItem(R.id.nav_mycart)); | ||
badge_layout.setGravity(Gravity.CENTER); | ||
mycart = new TextView(this); | ||
mycart.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, | ||
LinearLayout.LayoutParams.WRAP_CONTENT)); | ||
mycart.setText("3"); | ||
mycart.setBackgroundResource(R.drawable.roundtextview); | ||
mycart.setGravity(Gravity.CENTER); | ||
mycart.setTextColor(getResources().getColor(R.color.colorWhite)); | ||
badge_layout.addView(mycart); | ||
List<Fragment> fragments = getFragments(); | ||
HomepageAdapter pageAdapter = new HomepageAdapter(getSupportFragmentManager(), fragments); | ||
ViewPager pager = (ViewPager) findViewById(R.id.viewpager); | ||
pager.setAdapter(pageAdapter); | ||
CircleIndicator indicator = (CircleIndicator) findViewById(R.id.indicator); | ||
indicator.setBackgroundColor(Color.parseColor("#00000000")); | ||
indicator.setViewPager(pager); | ||
} | ||
|
||
@Override | ||
public void onBackPressed() { | ||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); | ||
if (drawer.isDrawerOpen(GravityCompat.START)) { | ||
drawer.closeDrawer(GravityCompat.START); | ||
} else { | ||
super.onBackPressed(); | ||
} | ||
} | ||
|
||
@Override | ||
public boolean onNavigationItemSelected(@NonNull MenuItem item) { | ||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); | ||
drawer.closeDrawer(GravityCompat.START); | ||
return true; | ||
} | ||
|
||
private List<Fragment> getFragments() { | ||
List<Fragment> fList = new ArrayList<Fragment>(); | ||
fList.add(HomepageFragment.newInstance(R.drawable.furniture1)); | ||
fList.add(HomepageFragment.newInstance(R.drawable.furniture)); | ||
fList.add(HomepageFragment.newInstance(R.drawable.furniture2)); | ||
return fList; | ||
} | ||
} |
33 changes: 0 additions & 33 deletions
33
app/src/main/java/com/neosoft/neostore/ui/HomepageFragment.java
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
import android.view.View; | ||
import android.widget.Button; | ||
import android.widget.EditText; | ||
import android.widget.Toast; | ||
|
||
import com.neosoft.neostore.R; | ||
import com.neosoft.neostore.model.login.LoginResponseModel; | ||
|
@@ -20,9 +21,8 @@ public class LoginActivity extends Activity implements View.OnClickListener{ | |
String email, pass; | ||
Validate valid = new Validate(); | ||
|
||
|
||
|
||
@Override protected void onCreate(Bundle savedInstanceState) { | ||
|
||
super.onCreate(savedInstanceState); | ||
|
||
editEmail = (EditText) findViewById(R.id.edtEmail); | ||
|
@@ -36,21 +36,30 @@ public class LoginActivity extends Activity implements View.OnClickListener{ | |
setContentView(R.layout.activity_login); | ||
Button signup = (Button) findViewById(R.id.btn_login_signup); | ||
signup.setOnClickListener(new View.OnClickListener() { | ||
@Override public void onClick(View v) { | ||
@Override | ||
public void onClick(View v) { | ||
Intent intent = new Intent(LoginActivity.this, RegisterScreen.class); | ||
startActivity(intent); | ||
} | ||
}); | ||
Button login = (Button) findViewById(R.id.btn_login); | ||
login.setOnClickListener(new View.OnClickListener() { | ||
@Override public void onClick(View v) { | ||
final EditText editPassword = (EditText) findViewById(R.id.edtPass); | ||
|
||
final EditText editEmail = (EditText) findViewById(R.id.edtEmail); | ||
|
||
login.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
GetServices apiServices = new GetServices(); | ||
apiServices.login("[email protected]", "abhijeet", new ApiResponse<LoginResponseModel>() { | ||
@Override public void onSuccess(LoginResponseModel response) { | ||
apiServices.login(editEmail.getText().toString(),editPassword.getText().toString(), new ApiResponse<LoginResponseModel>() { | ||
@Override | ||
public void onSuccess(LoginResponseModel response) { | ||
Toast.makeText(getApplicationContext(),response.getMessage().toString(),Toast.LENGTH_LONG).show(); | ||
Log.e("zzz", response.toString()); | ||
} | ||
@Override public void onError(String message) { | ||
|
||
@Override | ||
public void onError(String message) { | ||
Log.e("zzz", message); | ||
} | ||
}); | ||
|
Oops, something went wrong.