Skip to content

Commit

Permalink
Profile activity bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
tejma17 committed Apr 6, 2021
1 parent f3adb80 commit 6ce669f
Show file tree
Hide file tree
Showing 19 changed files with 108 additions and 33 deletions.
4 changes: 2 additions & 2 deletions inclusivo-app/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ android {
applicationId "com.dsciiita.inclusivo"
minSdkVersion 21
targetSdkVersion 30
versionCode 7
versionName "2.4"
versionCode 8
versionName "3.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import androidx.lifecycle.ViewModelProvider;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;
import com.dsciiita.inclusivo.R;
import com.dsciiita.inclusivo.adapters.CompanyProfileViewPagerAdapter;
import com.dsciiita.inclusivo.animations.ViewAnimations;
Expand Down Expand Up @@ -270,8 +272,10 @@ public void onFailure(Call<CompanyScholarshipResponse> call, Throwable t) {
private void setValues() {
binding.companyTitleTxt.setText(company.getName());
binding.companyProfileTxt.setText(company.getProfile());

Glide.with(getApplicationContext()).load(company.getLogoUrl())
.placeholder(Constants.PLACEHOLDER_IMAGE)
.apply(RequestOptions.bitmapTransform(new RoundedCorners(10)))
.into(binding.companyLogoImg);

binding.shimmerViewContainer.setVisibility(View.GONE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

import com.airbnb.lottie.LottieAnimationView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;
import com.dsciiita.inclusivo.R;
import com.dsciiita.inclusivo.adapters.JobDescriptionViewPagerAdapter;
import com.dsciiita.inclusivo.api.ApiClient;
Expand Down Expand Up @@ -342,41 +344,46 @@ private void setValues() {
binding.jobTitleTxt.setText(job.getTitle());
binding.jobTypeTxt.setText(job.getJobType());
binding.companyNameTxt.setText(job.getCompany().getName());

Glide.with(getApplicationContext()).load(job.getCompany().getLogoUrl())
.timeout(10000)
.placeholder(Constants.PLACEHOLDER_IMAGE)
.apply(RequestOptions.bitmapTransform(new RoundedCorners(10)))
.into(binding.companyLogoImg);

if(SharedPrefManager.getInstance(this).isEmployer())
binding.saveImg.setVisibility(View.GONE);
else{
if(isLiked)
binding.saveImg.setFrame(50);
else
binding.saveImg.setFrame(0);
}

binding.shimmerViewContainer.setVisibility(View.GONE);
binding.parentLayout.animate().alpha(1).setDuration(300);

if(SharedPrefManager.getInstance(this).isEmployer()){
setViewsGone(binding.btnApply, binding.btnEvaluate);
setViewsGone(binding.btnApply, binding.btnEvaluate, binding.saveImg);
status = job.getStatus();

if(SharedPrefManager.getInstance(this).getCompanyID()==job.getCompany().getId())
setViewsVisible(binding.btnEdit, binding.btnViewApplication);

if(status.equals("Hired") || status.equals("Expired"))
binding.btnEdit.setVisibility(View.GONE);
} else{
} else {
if(isLiked)
binding.saveImg.setFrame(50);
else
binding.saveImg.setFrame(0);

if(job.getStatus().equals("Expired")){
setViewsVisible(binding.applicationStatus);
setViewsGone(binding.btnApply);
setViewsGone(binding.btnApply, binding.saveImg);
Chip chip = (Chip) LayoutInflater.from(JobDescriptionActivity.this)
.inflate(R.layout.rejected_application_chip_layout, binding.applicationStatus, false);
.inflate(R.layout.job_status_chip_layout, binding.applicationStatus, false);
chip.setId(ViewCompat.generateViewId());
chip.setText("This job is expired");
chip.setCloseIconVisible(false);
binding.applicationStatus.addView(chip);
} else if(job.getStatus().equals("Hired")) {
setViewsVisible(binding.applicationStatus);
setViewsGone(binding.btnApply, binding.saveImg);
Chip chip = (Chip) LayoutInflater.from(JobDescriptionActivity.this)
.inflate(R.layout.job_status_chip_layout, binding.applicationStatus, false);
chip.setId(ViewCompat.generateViewId());
chip.setText("Hiring is closed for this job");
binding.applicationStatus.addView(chip);
}
else if(isApplied){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ protected void onCreate(Bundle savedInstanceState) {
}
return false;
});


binding.category.setOnItemSelectedListener(myListener);
binding.cancelSearch.setOnClickListener(view-> {
binding.searchBar.setVisibility(View.GONE);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package com.dsciiita.inclusivo.activities;

import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;

import androidx.appcompat.app.ActionBarDrawerToggle;
Expand All @@ -29,6 +32,8 @@
import com.google.android.material.navigation.NavigationView;
import com.google.gson.Gson;

import java.util.Objects;

import de.hdodenhof.circleimageview.CircleImageView;
import retrofit2.Call;
import retrofit2.Callback;
Expand Down Expand Up @@ -65,6 +70,15 @@ private void setUpSideNavigation(){
toggle.syncState();

mainBinding.mainNavView.setNavigationItemSelectedListener(this);

try {
PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
String version = "Version "+pInfo.versionName;
mainBinding.versionCode.setText(version);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
mainBinding.versionCode.setVisibility(View.GONE);
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import androidx.lifecycle.ViewModelProvider;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;
import com.dsciiita.inclusivo.R;
import com.dsciiita.inclusivo.adapters.ScholarshipDescriptionViewPagerAdapter;
import com.dsciiita.inclusivo.api.ApiClient;
Expand Down Expand Up @@ -174,6 +176,7 @@ private void setValues() {
Glide.with(getApplicationContext()).load(scholarship.getCompany().getLogoUrl())
.timeout(10000)
.placeholder(Constants.PLACEHOLDER_IMAGE)
.apply(RequestOptions.bitmapTransform(new RoundedCorners(10)))
.into(binding.companyLogoImg);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import com.airbnb.lottie.LottieAnimationView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;
import com.dsciiita.inclusivo.R;
import com.dsciiita.inclusivo.activities.JobDescriptionActivity;
import com.dsciiita.inclusivo.api.ApiClient;
Expand Down Expand Up @@ -106,6 +108,7 @@ public void onBindViewHolder(@NonNull ViewHolder holder, final int position) {
if(jobList.get(position).getJob().getCompany().getLogoUrl()!=null)
Glide.with(context).load(jobList.get(position).getJob().getCompany().getLogoUrl())
.placeholder(R.drawable.ic_companies)
.apply(RequestOptions.bitmapTransform(new RoundedCorners(10)))
.into(holder.companyImg);
else
holder.companyImg.setImageResource(R.drawable.ic_companies);
Expand Down Expand Up @@ -134,7 +137,10 @@ public void onBindViewHolder(@NonNull ViewHolder holder, final int position) {
}
holder.timeDiff.setText(diff);

if (jobList.get(position).getJob().isLiked()) {
if(jobList.get(position).getJob().getStatus().equals("Hired")
|| jobList.get(position).getJob().getStatus().equals("Expired"))
holder.saveAnim.setVisibility(View.GONE);
else if (jobList.get(position).getJob().isLiked()) {
holder.saveAnim.setFrame(50);
holder.saveAnim.setTag(R.drawable.ic_save_red_filled);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import androidx.recyclerview.widget.RecyclerView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;
import com.dsciiita.inclusivo.R;
import com.dsciiita.inclusivo.models.Company;
import com.dsciiita.inclusivo.models.Job;
Expand Down Expand Up @@ -48,6 +50,7 @@ public void onBindViewHolder(@NonNull ViewHolder holder, final int position) {
if(companyList.get(position).getLogoUrl()!=null)
Glide.with(context).load(companyList.get(position).getLogoUrl())
.placeholder(R.drawable.ic_companies)
.apply(RequestOptions.bitmapTransform(new RoundedCorners(10)))
.into(holder.image);
else
holder.image.setBackgroundResource(R.drawable.ic_companies);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

import com.airbnb.lottie.LottieAnimationView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;
import com.dsciiita.inclusivo.R;
import com.dsciiita.inclusivo.activities.JobDescriptionActivity;
import com.dsciiita.inclusivo.api.ApiClient;
Expand Down Expand Up @@ -100,6 +102,7 @@ public void onBindViewHolder(@NonNull ViewHolder holder, final int position) {
if(jobList.get(position).getCompany().getLogoUrl()!=null)
Glide.with(context).load(jobList.get(position).getCompany().getLogoUrl())
.placeholder(R.drawable.ic_companies)
.apply(RequestOptions.bitmapTransform(new RoundedCorners(10)))
.into(holder.companyImg);
else
holder.companyImg.setBackgroundResource(R.drawable.ic_companies);
Expand Down Expand Up @@ -143,6 +146,8 @@ public void onBindViewHolder(@NonNull ViewHolder holder, final int position) {

if(SharedPrefManager.getInstance(context).isEmployer())
holder.saveAnim.setVisibility(View.GONE);
else if(jobList.get(position).getStatus().equals("Hired") || jobList.get(position).getStatus().equals("Expired"))
holder.saveAnim.setVisibility(View.GONE);
else {
if (jobList.get(position).isLiked()) {
holder.saveAnim.setFrame(50);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

import com.airbnb.lottie.LottieAnimationView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.request.target.Target;
import com.dsciiita.inclusivo.R;
import com.dsciiita.inclusivo.api.ApiClient;
Expand Down Expand Up @@ -76,6 +78,7 @@ public void onBindViewHolder(@NonNull ViewHolder holder, final int position) {
if(objectList.get(position).getCompany().getLogoUrl()!=null)
Glide.with(context).load(objectList.get(position).getCompany().getLogoUrl())
.placeholder(R.drawable.ic_companies)
.apply(RequestOptions.bitmapTransform(new RoundedCorners(10)))
.into(holder.profile);
else
holder.profile.setBackgroundResource(R.drawable.ic_companies);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ public class Constants {
public static String WORKING_MOTHER_URL = "https://imgur.com/4zo39Yt.jpg";
public static String SPECIALLY_ABLED_URL = "https://imgur.com/Nfy0VPy.jpg";

public static String PUNE_URL = "https://i.imgur.com/m1yOb3C.jpg";
public static String MUMBAI_URL = "https://i.imgur.com/rJDpW3e.jpg";
public static String DELHI_URL = "https://i.imgur.com/OYuJUQM.jpg";
public static String GURGAON_URL = "https://i.imgur.com/YHM5fzS.jpg";
public static String CHENNAI_URL = "https://i.imgur.com/uhB4F1m.jpg";
public static String BENGALURU_URL = "https://i.imgur.com/JaBYAv4.jpg";
public static String PUNE_URL = "https://imgur.com/IfXDEUG.jpg";
public static String MUMBAI_URL = "https://imgur.com/NJZBoIz.jpg";
public static String DELHI_URL = "https://imgur.com/WMuvGDA.jpg";
public static String GURGAON_URL = "https://imgur.com/ln7UWq8.jpg";
public static String CHENNAI_URL = "https://imgur.com/nHLwjZH.jpg";
public static String BENGALURU_URL = "https://imgur.com/aigq4T4.jpg";
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@

<ImageView
android:id="@+id/company_logo_img"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_width="52dp"
android:layout_height="52dp"
android:layout_marginStart="16dp"
android:layout_marginTop="32dp"
android:scaleType="fitXY"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
android:layout_marginStart="10dp"
android:fontFamily="@font/roboto_medium"
android:gravity="start"
android:layout_weight="4"
android:layout_weight="3.5"
android:entries="@array/job_search_categories"
android:inputType="phone"
android:textColor="@color/black"
Expand All @@ -72,7 +72,7 @@
android:layout_marginEnd="10dp"
android:paddingHorizontal="5dp"
android:layout_weight="5"
android:fontFamily="@font/roboto_regular"
android:fontFamily="@font/varela_round"
android:hint="Search"
android:singleLine="true"
android:imeOptions="actionSearch"
Expand All @@ -84,6 +84,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:padding="0dp"
android:layout_marginEnd="3dp"
android:layout_weight="1"
android:gravity="center"
android:backgroundTint="@android:color/transparent"
Expand Down
11 changes: 11 additions & 0 deletions inclusivo-app/app/src/main/res/layout/activity_navigation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/side_nav_menu">

<TextView
android:id="@+id/version_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Version"
android:layout_marginBottom="30dp"
android:fontFamily="@font/varela_round"
android:layout_gravity="bottom|center_horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>

</com.google.android.material.navigation.NavigationView>

Expand Down
6 changes: 3 additions & 3 deletions inclusivo-app/app/src/main/res/layout/activity_profile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:visibility="visible"
android:visibility="gone"
android:id="@+id/parent" >

<LinearLayout
Expand Down Expand Up @@ -361,7 +361,7 @@
android:layout_marginHorizontal="16dp"
android:layout_marginTop="16dp"
android:fontFamily="@font/varela_round"
android:text="Contact Number *"
android:text="Contact Number"
android:textColor="@color/black"
android:textSize="12sp" />

Expand All @@ -381,7 +381,7 @@
android:layout_marginHorizontal="16dp"
android:layout_marginTop="16dp"
android:fontFamily="@font/varela_round"
android:text="Alternate Contact Number *"
android:text="Alternate Contact Number"
android:textColor="@color/black"
android:textSize="12sp" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:visibility="visible"
android:visibility="gone"
android:id="@+id/parent" >

<LinearLayout
Expand Down Expand Up @@ -255,7 +255,7 @@
android:layout_marginHorizontal="16dp"
android:layout_marginTop="16dp"
android:fontFamily="@font/varela_round"
android:text="Alternate Contact Number *"
android:text="Alternate Contact Number"
android:textColor="@color/black"
android:textSize="12sp" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<ImageView
android:id="@+id/company_logo_img"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_height="52dp"
android:layout_marginStart="16dp"
android:scaleType="fitXY"
android:src="@drawable/ic_companies"
Expand Down
15 changes: 15 additions & 0 deletions inclusivo-app/app/src/main/res/layout/job_status_chip_layout.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.chip.Chip
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="Unavailable"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:chipCornerRadius="15dp"
android:textAppearance="@style/statusChipStyle"
app:chipBackgroundColor="#FFC9C3"
android:textAlignment="center"
android:clickable="false"
android:textColor="#BB4E3F"
android:ellipsize="end">
</com.google.android.material.chip.Chip>
Loading

0 comments on commit 6ce669f

Please sign in to comment.