24
24
import java .io .IOException ;
25
25
import java .util .Random ;
26
26
27
+ import javax .inject .Inject ;
28
+
27
29
import butterknife .BindView ;
28
30
import butterknife .ButterKnife ;
29
31
import dagger .Binds ;
30
32
import fr .free .nrw .commons .R ;
33
+ import fr .free .nrw .commons .auth .SessionManager ;
31
34
import fr .free .nrw .commons .theme .NavigationBaseActivity ;
32
35
36
+ /**
37
+ * activity for sharing feedback on uploaded activity
38
+ */
33
39
public class AchievementsActivity extends NavigationBaseActivity {
34
40
35
41
private static final double BADGE_IMAGE_WIDTH_RATIO = 0.4 ;
36
42
private static final double BADGE_IMAGE_HEIGHT_RATIO = 0.3 ;
37
43
38
44
@ BindView (R .id .achievement_badge ) ImageView imageView ;
39
45
@ BindView (R .id .toolbar ) android .support .v7 .widget .Toolbar toolbar ;
40
-
46
+ @ Inject SessionManager sessionManager ;
41
47
42
48
/**
43
- * This method helps in the creation Achievement screen
49
+ * This method helps in the creation Achievement screen and
50
+ * dynamically set the size of imageView
44
51
*
45
52
* @param savedInstanceState Data bundle
46
53
*/
@@ -50,12 +57,17 @@ protected void onCreate(Bundle savedInstanceState) {
50
57
super .onCreate (savedInstanceState );
51
58
setContentView (R .layout .activity_achievements );
52
59
ButterKnife .bind (this );
53
-
60
+ /**
61
+ * DisplayMetrics used to fetch the size of the screen
62
+ */
54
63
DisplayMetrics displayMetrics = new DisplayMetrics ();
55
64
getWindowManager ().getDefaultDisplay ().getMetrics (displayMetrics );
56
65
int height = displayMetrics .heightPixels ;
57
66
int width = displayMetrics .widthPixels ;
58
67
68
+ /**
69
+ * Used for the setting the size of imageView at runtime
70
+ */
59
71
RelativeLayout .LayoutParams params = (RelativeLayout .LayoutParams )
60
72
imageView .getLayoutParams ();
61
73
params .height = (int ) (height *BADGE_IMAGE_HEIGHT_RATIO );
0 commit comments