Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add slide up down animation #2186

Merged
merged 1 commit into from
Aug 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,13 @@ dependencies {
// Searchable Spinner
implementation 'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'

//ExpandableTextView
implementation 'at.blogc:expandabletextview:1.0.5'

//ExpandableView
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'



testImplementation 'junit:junit:4.12'
testImplementation 'org.threeten:threetenbp:1.4.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,14 +415,9 @@ class EventDetailsFragment : Fragment() {
// Organizer Section
if (!event.ownerName.isNullOrEmpty()) {
val organizerDescriptionListener = View.OnClickListener {
if (rootView.seeMoreOrganizer.text == getString(R.string.see_more)) {
rootView.seeMoreOrganizer.text = getString(R.string.see_less)
rootView.eventOrganiserDescription.minLines = 0
rootView.eventOrganiserDescription.maxLines = Int.MAX_VALUE
} else {
rootView.seeMoreOrganizer.text = getString(R.string.see_more)
rootView.eventOrganiserDescription.setLines(3)
}
rootView.eventOrganiserDescription.toggle()
rootView.seeMoreOrganizer.text = if (rootView.eventOrganiserDescription.isExpanded)
getString(R.string.see_less) else getString(R.string.see_more)
}

rootView.eventOrganiserDescription.post {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,9 @@ class SessionFragment : Fragment() {
false -> {
rootView.sessionDetailAbstract.text = description.stripHtml()
val sessionAbstractClickListener = View.OnClickListener {
if (rootView.sessionDetailAbstractSeeMore.text == getString(R.string.see_more)) {
rootView.sessionDetailAbstractSeeMore.text = getString(R.string.see_less)
rootView.sessionDetailAbstract.minLines = 0
rootView.sessionDetailAbstract.maxLines = Int.MAX_VALUE
} else {
rootView.sessionDetailAbstractSeeMore.text = getString(R.string.see_more)
rootView.sessionDetailAbstract.setLines(LINE_COUNT_ABSTRACT + 1)
}
rootView.sessionDetailAbstract.toggle()
rootView.sessionDetailAbstractSeeMore.text = if (rootView.sessionDetailAbstract.isExpanded)
getString(R.string.see_less) else getString(R.string.see_more)
}

rootView.sessionDetailAbstract.post {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class SpeakersCallProposalFragment : Fragment(), ComplexBackPressFragment {
.observe(viewLifecycleOwner, Observer {
rootView.speakerProgressBar.isVisible = it
})
rootView.speakerInfoContainer.isVisible = speakersCallProposalViewModel.isSpeakerInfoShown
rootView.speakerInfoContainer.isExpanded = speakersCallProposalViewModel.isSpeakerInfoShown

rootView.titleLayout.setRequired()
setupTrack()
Expand All @@ -159,7 +159,7 @@ class SpeakersCallProposalFragment : Fragment(), ComplexBackPressFragment {

rootView.expandSpeakerDetailButton.setOnClickListener {
speakersCallProposalViewModel.isSpeakerInfoShown = !speakersCallProposalViewModel.isSpeakerInfoShown
rootView.speakerInfoContainer.isVisible = speakersCallProposalViewModel.isSpeakerInfoShown
rootView.speakerInfoContainer.toggle()
}

rootView.submitProposalButton.setOnClickListener {
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/content_event.xml
Original file line number Diff line number Diff line change
Expand Up @@ -433,16 +433,18 @@
android:textColor="@color/light_grey"
android:textSize="@dimen/event_details_headers" />

<TextView
<at.blogc.android.views.ExpandableTextView
android:id="@+id/eventOrganiserDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:strippedHtml="@{event.ownerDescription}"
app:hideIfEmpty="@{event.ownerDescription}"
android:layout_marginBottom="@dimen/layout_margin_small"
android:background="?selectableItemBackground"
android:ellipsize="end"
android:lines="3"
android:textColor="@color/light_grey"
app:animation_duration="300"
tools:text="Description" />

<TextView
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/fragment_session.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,14 @@
android:textColor="@color/dark_grey"
android:textSize="@dimen/event_details_headers"
android:layout_marginBottom="@dimen/layout_margin_medium"/>
<TextView
<at.blogc.android.views.ExpandableTextView
android:id="@+id/sessionDetailAbstract"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:lines="4"
android:autoLink="web|email|phone"
android:background="?selectableItemBackground"
tools:text="@string/description_preview"/>
<TextView
android:id="@+id/sessionDetailAbstractSeeMore"
Expand Down
Loading