Skip to content

Commit

Permalink
patch: CircleImageView issue (#231)
Browse files Browse the repository at this point in the history
* Encoded Bitmap

* Improved Homepage and nav header
  • Loading branch information
somenath1435 authored and atm1504 committed Jun 19, 2019
1 parent e84e7ef commit 31ee997
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
5 changes: 4 additions & 1 deletion app/src/main/java/com/example/saar/Home/HomeFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public class HomeFragment extends Fragment implements View.OnClickListener {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_home, container, false);
View rootView = inflater.inflate(R.layout.fragment_home, container, false);
rootView.findViewById(R.id.homepage_abhinav_civ).setLayerType(View.LAYER_TYPE_SOFTWARE, null);
rootView.findViewById(R.id.homepage_vivek_civ).setLayerType(View.LAYER_TYPE_SOFTWARE, null);
return rootView;
}

@Override
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/com/example/saar/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ protected void onCreate(Bundle savedInstanceState) {
LinearLayout header = (LinearLayout) headerview.findViewById(R.id.nav_layout);
name = headerview.findViewById(R.id.nav_header_name);
email = headerview.findViewById(R.id.nav_header_email);
header.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
circleImageView = headerview.findViewById(R.id.nav_header_image);
setHeaderData();
header.setOnClickListener(new View.OnClickListener() {
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/example/saar/Team/TeamFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,

for (int position = 0; position < IMAGE_ID.length; position++) {
CircleImageView circleImageView = rootView.findViewById(IMAGE_VIEW_ID[position]);
circleImageView.setImageResource(IMAGE_ID[position]);
//circleImageView.setImageResource(IMAGE_ID[position]);
circleImageView.setImageBitmap(decodeSampledBitmapFromResource(getResources(), IMAGE_ID[position], 70, 70));
}


Expand Down
6 changes: 4 additions & 2 deletions app/src/main/res/layout/fragment_home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@
android:layout_width="@dimen/no_margin"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center">
android:gravity="center"
android:id="@+id/homepage_abhinav_civ">

<de.hdodenhof.circleimageview.CircleImageView
android:layout_width="@dimen/circular_image_dimension"
Expand All @@ -127,7 +128,8 @@
android:layout_width="@dimen/no_margin"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center">
android:gravity="center"
android:id="@+id/homepage_vivek_civ">

<de.hdodenhof.circleimageview.CircleImageView
android:layout_width="@dimen/circular_image_dimension"
Expand Down

0 comments on commit 31ee997

Please sign in to comment.