Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InstiApp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
RAHUL SHARMA
InstiApp
Commits
3ad05091
Commit
3ad05091
authored
Feb 04, 2019
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix going/interested for dark theme
parent
d184dc07
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
12 deletions
+28
-12
app/src/main/java/app/insti/Utils.java
app/src/main/java/app/insti/Utils.java
+9
-0
app/src/main/java/app/insti/fragment/CalendarFragment.java
app/src/main/java/app/insti/fragment/CalendarFragment.java
+2
-1
app/src/main/java/app/insti/fragment/EventFragment.java
app/src/main/java/app/insti/fragment/EventFragment.java
+16
-5
app/src/main/java/app/insti/fragment/MapFragment.java
app/src/main/java/app/insti/fragment/MapFragment.java
+1
-6
No files found.
app/src/main/java/app/insti/Utils.java
View file @
3ad05091
...
...
@@ -3,6 +3,7 @@ package app.insti;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.res.Resources
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.support.annotation.RequiresApi
;
...
...
@@ -13,6 +14,7 @@ import android.support.transition.Transition;
import
android.support.v4.app.Fragment
;
import
android.support.v4.app.FragmentActivity
;
import
android.support.v4.app.FragmentTransaction
;
import
android.util.TypedValue
;
import
android.view.View
;
import
android.webkit.CookieManager
;
import
android.widget.ImageView
;
...
...
@@ -250,6 +252,13 @@ public final class Utils {
}
}
public
static
int
getAttrColor
(
Context
context
,
int
attrId
)
{
TypedValue
typedValue
=
new
TypedValue
();
Resources
.
Theme
theme
=
context
.
getTheme
();
theme
.
resolveAttribute
(
attrId
,
typedValue
,
true
);
return
typedValue
.
data
;
}
@RequiresApi
(
21
)
public
static
void
clearCookies
(
Context
context
)
{
CookieManager
.
getInstance
().
removeAllCookies
(
null
);
...
...
app/src/main/java/app/insti/fragment/CalendarFragment.java
View file @
3ad05091
...
...
@@ -156,7 +156,8 @@ public class CalendarFragment extends BaseFragment {
/** Decorator for Calendar */
private
class
EventDecorator
implements
DayViewDecorator
{
private
final
int
color
=
getResources
().
getColor
(
R
.
color
.
colorAccent
);
private
final
int
white
=
getResources
().
getColor
(
R
.
color
.
primaryTextColor
);
private
final
int
white
=
Utils
.
getAttrColor
(
getContext
(),
R
.
attr
.
themeColor
);
private
final
HashSet
<
CalendarDay
>
dates
;
private
final
int
alpha
;
...
...
app/src/main/java/app/insti/fragment/EventFragment.java
View file @
3ad05091
...
...
@@ -27,9 +27,7 @@ import android.text.TextPaint;
import
android.text.TextUtils
;
import
android.text.method.LinkMovementMethod
;
import
android.text.style.ClickableSpan
;
import
android.text.style.ForegroundColorSpan
;
import
android.text.style.RelativeSizeSpan
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
...
...
@@ -120,7 +118,6 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
// Set font face and color of badge
spannable
.
setSpan
(
new
RelativeSizeSpan
(
0.75f
),
text
.
length
(),
text
.
length
()
+
1
+
countString
.
length
(),
Spannable
.
SPAN_INCLUSIVE_INCLUSIVE
);
spannable
.
setSpan
(
new
ForegroundColorSpan
(
Color
.
DKGRAY
),
text
.
length
(),
text
.
length
()
+
1
+
countString
.
length
(),
Spannable
.
SPAN_INCLUSIVE_INCLUSIVE
);
return
spannable
;
}
...
...
@@ -358,9 +355,23 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
});
}
/** Setup button colors depending on status */
void
setFollowButtonColors
(
int
status
)
{
interestedButton
.
setBackgroundColor
(
getResources
().
getColor
(
status
==
Constants
.
STATUS_INTERESTED
?
R
.
color
.
colorAccent
:
R
.
color
.
colorWhite
));
goingButton
.
setBackgroundColor
(
getResources
().
getColor
(
status
==
Constants
.
STATUS_GOING
?
R
.
color
.
colorAccent
:
R
.
color
.
colorWhite
));
// Get background colors
final
int
themeColor
=
Utils
.
getAttrColor
(
getContext
(),
R
.
attr
.
themeColor
);
final
int
accent
=
getResources
().
getColor
(
R
.
color
.
colorAccent
);
// Get font colors
final
int
themeColorInverse
=
Utils
.
getAttrColor
(
getContext
(),
R
.
attr
.
themeColorInverse
);
final
int
black
=
Color
.
BLACK
;
// Set background colors
interestedButton
.
setBackgroundColor
(
status
==
Constants
.
STATUS_INTERESTED
?
accent
:
themeColor
);
goingButton
.
setBackgroundColor
(
status
==
Constants
.
STATUS_GOING
?
accent
:
themeColor
);
// Set font colors
interestedButton
.
setTextColor
(
status
==
Constants
.
STATUS_INTERESTED
?
black
:
themeColorInverse
);
goingButton
.
setTextColor
(
status
==
Constants
.
STATUS_GOING
?
black
:
themeColorInverse
);
// Show badges
interestedButton
.
setText
(
getCountBadgeSpannable
(
"INTERESTED"
,
event
.
getEventInterestedCount
()));
...
...
app/src/main/java/app/insti/fragment/MapFragment.java
View file @
3ad05091
...
...
@@ -7,7 +7,6 @@ import android.content.Context;
import
android.content.IntentSender
;
import
android.content.pm.PackageManager
;
import
android.content.res.Configuration
;
import
android.content.res.Resources
;
import
android.graphics.Color
;
import
android.graphics.PointF
;
import
android.graphics.Typeface
;
...
...
@@ -40,7 +39,6 @@ import android.text.style.ClickableSpan;
import
android.text.style.StyleSpan
;
import
android.text.util.Linkify
;
import
android.util.Log
;
import
android.util.TypedValue
;
import
android.view.KeyEvent
;
import
android.view.LayoutInflater
;
import
android.view.MenuItem
;
...
...
@@ -241,10 +239,7 @@ public class MapFragment extends Fragment implements TextWatcher,
if
(
response
.
isSuccessful
())
{
// Setup fade animation for background
TypedValue
typedValue
=
new
TypedValue
();
Resources
.
Theme
theme
=
getContext
().
getTheme
();
theme
.
resolveAttribute
(
R
.
attr
.
themeColor
,
typedValue
,
true
);
int
colorFrom
=
typedValue
.
data
;
int
colorFrom
=
Utils
.
getAttrColor
(
getContext
(),
R
.
attr
.
themeColor
);
int
colorTo
=
getResources
().
getColor
(
R
.
color
.
colorGray
);
ValueAnimator
colorAnimation
=
ValueAnimator
.
ofObject
(
new
ArgbEvaluator
(),
colorFrom
,
colorTo
);
colorAnimation
.
setDuration
(
250
);
// milliseconds
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment