Skip to content

Commit cf47bfc

Browse files
Merge pull request #1523 from fossasia/development
chore: Release v0.1.1
2 parents d5ad590 + 7af741c commit cf47bfc

14 files changed

+56
-61
lines changed

app/build.gradle

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ android {
1717
applicationId "com.eventyay.attendee"
1818
minSdkVersion 16
1919
targetSdkVersion 28
20-
versionCode 4
21-
versionName "0.1.0"
20+
versionCode 5
21+
versionName "0.1.1"
2222
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2323
vectorDrawables.useSupportLibrary = true
2424
multiDexEnabled true
@@ -33,6 +33,7 @@ android {
3333
}
3434
buildTypes {
3535
release {
36+
shrinkResources true
3637
minifyEnabled true
3738
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
3839
buildConfigField "String", "DEFAULT_BASE_URL", '"https://api.eventyay.com/v1/"'
@@ -72,6 +73,9 @@ android {
7273
androidExtensions {
7374
experimental = true
7475
}
76+
aaptOptions {
77+
cruncherEnabled = false
78+
}
7579
}
7680

7781
spotless {
@@ -172,9 +176,6 @@ dependencies {
172176
releaseImplementation 'com.github.iamareebjamal:stetho-noop:1.2.1'
173177
testImplementation 'com.github.iamareebjamal:stetho-noop:1.2.1'
174178

175-
//Mapbox SDK plugins
176-
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-places-v7:0.7.0'
177-
178179
testImplementation 'junit:junit:4.12'
179180
testImplementation "io.mockk:mockk:1.9.3"
180181
testImplementation 'org.threeten:threetenbp:1.3.8'

app/src/main/java/org/fossasia/openevent/general/auth/EditProfileViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class EditProfileViewModel(
4444
.subscribe({
4545
updateUser(it.url, firstName, lastName)
4646
mutableMessage.value = "Image uploaded successfully!"
47-
Timber.d("Image uploaded " + it.url)
47+
Timber.d("Image uploaded ${it.url}")
4848
}) {
4949
mutableMessage.value = "Error uploading image!"
5050
Timber.e(it, "Error uploading user!")

app/src/main/java/org/fossasia/openevent/general/auth/LoginViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class LoginViewModel(
8888
mutableProgress.value = true
8989
}.doFinally {
9090
mutableProgress.value = false
91-
}.subscribe({ it ->
91+
}.subscribe({
9292
Timber.d("User Fetched")
9393
mutableUser.value = it
9494
}) {

app/src/main/java/org/fossasia/openevent/general/event/EventDetailsFragment.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ class EventDetailsFragment : Fragment() {
210210

211211
// Event Description Section
212212
if (!event.description.isNullOrEmpty()) {
213-
setTextField(rootView.eventDescription, event.description?.stripHtml())
213+
setTextField(rootView.eventDescription, event.description.stripHtml())
214214

215215
rootView.eventDescription.post {
216216
if (rootView.eventDescription.lineCount > LINE_COUNT) {
@@ -246,6 +246,7 @@ class EventDetailsFragment : Fragment() {
246246
Picasso.get()
247247
.load(eventViewModel.loadMap(event))
248248
.placeholder(R.drawable.ic_map_black)
249+
.error(R.drawable.ic_map_black)
249250
.into(rootView.imageMap)
250251
}
251252

app/src/main/java/org/fossasia/openevent/general/event/EventService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class EventService(
3636
private fun getEventTopicList(eventsList: List<Event>): List<EventTopic?> {
3737
return eventsList
3838
.filter { it.eventTopic != null }
39-
.map { it -> it.eventTopic }
39+
.map { it.eventTopic }
4040
.toList()
4141
}
4242

app/src/main/java/org/fossasia/openevent/general/search/SearchLocationFragment.kt

Lines changed: 33 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,25 @@ import android.Manifest
44
import android.content.pm.PackageManager
55
import android.os.Bundle
66
import android.view.LayoutInflater
7+
import android.view.MenuItem
78
import android.view.View
89
import android.view.ViewGroup
910
import androidx.appcompat.app.AppCompatActivity
11+
import androidx.appcompat.widget.SearchView
1012
import androidx.core.content.ContextCompat
1113
import androidx.fragment.app.Fragment
1214
import androidx.lifecycle.Observer
1315
import androidx.navigation.Navigation
1416
import androidx.navigation.fragment.navArgs
1517
import com.google.android.material.snackbar.Snackbar
16-
import com.mapbox.api.geocoding.v5.models.CarmenFeature
17-
import com.mapbox.mapboxsdk.plugins.places.autocomplete.model.PlaceOptions
18-
import com.mapbox.mapboxsdk.plugins.places.autocomplete.ui.PlaceAutocompleteFragment
19-
import com.mapbox.mapboxsdk.plugins.places.autocomplete.ui.PlaceSelectionListener
2018
import kotlinx.android.synthetic.main.fragment_search_location.view.currentLocationLinearLayout
2119
import kotlinx.android.synthetic.main.fragment_search_location.view.locationProgressBar
22-
import org.fossasia.openevent.general.BuildConfig
20+
import kotlinx.android.synthetic.main.fragment_search_location.view.locationSearchView
2321
import org.fossasia.openevent.general.R
22+
import org.fossasia.openevent.general.utils.Utils
2423
import org.koin.androidx.viewmodel.ext.android.viewModel
2524

2625
const val LOCATION_PERMISSION_REQUEST = 1000
27-
const val AUTOCOMPLETE_FRAG_TAG = "AutoComplete_Frag"
2826

2927
class SearchLocationFragment : Fragment() {
3028
private lateinit var rootView: View
@@ -37,7 +35,8 @@ class SearchLocationFragment : Fragment() {
3735

3836
val thisActivity = activity
3937
if (thisActivity is AppCompatActivity) {
40-
thisActivity.supportActionBar?.hide()
38+
thisActivity.supportActionBar?.show()
39+
thisActivity.supportActionBar?.setDisplayHomeAsUpEnabled(true)
4140
}
4241
setHasOptionsMenu(true)
4342

@@ -56,11 +55,37 @@ class SearchLocationFragment : Fragment() {
5655
redirectToMain()
5756
})
5857

59-
setupPlaceAutoCompleteFrag(savedInstanceState)
58+
rootView.locationSearchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
59+
override fun onQueryTextSubmit(query: String): Boolean {
60+
searchLocationViewModel.saveSearch(query)
61+
redirectToMain()
62+
return false
63+
}
64+
65+
override fun onQueryTextChange(newText: String): Boolean {
66+
return false
67+
}
68+
})
6069

6170
return rootView
6271
}
6372

73+
override fun onResume() {
74+
super.onResume()
75+
Utils.showSoftKeyboard(context, rootView.locationSearchView)
76+
}
77+
78+
override fun onOptionsItemSelected(item: MenuItem): Boolean {
79+
return when (item.itemId) {
80+
android.R.id.home -> {
81+
Utils.hideSoftKeyboard(context, rootView)
82+
activity?.onBackPressed()
83+
true
84+
}
85+
else -> super.onOptionsItemSelected(item)
86+
}
87+
}
88+
6489
private fun checkLocationPermission() {
6590
val permission =
6691
ContextCompat.checkSelfPermission(requireContext(), Manifest.permission.ACCESS_COARSE_LOCATION)
@@ -75,37 +100,6 @@ class SearchLocationFragment : Fragment() {
75100
Navigation.findNavController(rootView).popBackStack(fragmentId, false)
76101
}
77102

78-
private fun setupPlaceAutoCompleteFrag(savedInstanceState: Bundle?) {
79-
80-
val autocompleteFragment: PlaceAutocompleteFragment?
81-
if (savedInstanceState == null) {
82-
val placeOptions = PlaceOptions.builder().build(PlaceOptions.MODE_CARDS)
83-
autocompleteFragment = PlaceAutocompleteFragment.newInstance(
84-
BuildConfig.MAPBOX_KEY, placeOptions)
85-
val transaction = fragmentManager?.beginTransaction()
86-
transaction?.add(R.id.autocomplete_frag_container, autocompleteFragment,
87-
AUTOCOMPLETE_FRAG_TAG)
88-
transaction?.commit()
89-
} else {
90-
autocompleteFragment = fragmentManager?.findFragmentByTag(
91-
AUTOCOMPLETE_FRAG_TAG) as? PlaceAutocompleteFragment
92-
}
93-
94-
autocompleteFragment?.setOnPlaceSelectedListener(object : PlaceSelectionListener {
95-
override fun onPlaceSelected(carmenFeature: CarmenFeature) {
96-
val location = carmenFeature.placeName()?.split(",")?.first()
97-
location?.let {
98-
searchLocationViewModel.saveSearch(it)
99-
redirectToMain()
100-
}
101-
}
102-
103-
override fun onCancel() {
104-
activity?.onBackPressed()
105-
}
106-
})
107-
}
108-
109103
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) {
110104
when (requestCode) {
111105
LOCATION_PERMISSION_REQUEST -> {

app/src/main/java/org/fossasia/openevent/general/ticket/TicketDetailsViewHolder.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ class TicketDetailsViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView
1414
}
1515

1616
if (ticket.price != null) {
17-
itemView.price.text = "${eventCurrency}${ticket.price}"
17+
itemView.price.text = "$eventCurrency${ticket.price}"
1818
}
1919

2020
if (ticket.price == 0.toFloat()) {
2121
itemView.price.text = "Free"
2222
}
2323

24-
val subTotal: Float? = ticket.price?.toFloat()?.times(qty[adapterPosition])
24+
val subTotal: Float? = ticket.price?.times(qty[adapterPosition])
2525
itemView.qty.text = qty[adapterPosition].toString()
2626
itemView.subTotal.text = "$$subTotal"
2727
}

app/src/main/java/org/fossasia/openevent/general/ticket/TicketViewHolder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class TicketViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
4343
}
4444

4545
if (ticket.price != null) {
46-
itemView.price.text = "${eventCurrency}${ticket.price}"
46+
itemView.price.text = "$eventCurrency${ticket.price}"
4747
}
4848

4949
if (ticket.price == 0.toFloat()) {

app/src/main/res/drawable/header.png

-3.74 KB
Loading
-25.3 KB
Loading

app/src/main/res/layout/content_event.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@
274274
android:layout_width="match_parent"
275275
android:layout_height="@dimen/home_logo_width"
276276
android:layout_marginBottom="@dimen/divider_margin_bottom"
277+
android:scaleType="centerCrop"
277278
android:src="@drawable/header"
278279
android:visibility="gone" />
279280
</LinearLayout>

app/src/main/res/layout/fragment_attendee.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
2-
xmlns:app="http://schemas.android.com/apk/res-auto"
32
xmlns:tools="http://schemas.android.com/tools"
43
android:id="@+id/attendeeScrollView"
54
android:layout_width="match_parent"

app/src/main/res/layout/fragment_order_details.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:app="http://schemas.android.com/apk/res-auto"
43
xmlns:tools="http://schemas.android.com/tools"
54
android:layout_width="match_parent"
65
android:layout_height="match_parent"

app/src/main/res/layout/fragment_search_location.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@
66
android:layout_height="match_parent"
77
android:orientation="vertical">
88

9-
<FrameLayout
10-
android:id="@+id/autocomplete_frag_container"
9+
<androidx.appcompat.widget.SearchView
10+
android:id="@+id/locationSearchView"
1111
android:layout_width="match_parent"
12-
android:layout_height="0dp"
12+
android:layout_height="wrap_content"
1313
android:layout_marginStart="@dimen/layout_margin_medium"
1414
android:layout_marginLeft="@dimen/layout_margin_medium"
1515
android:layout_marginTop="@dimen/layout_margin_medium"
1616
android:layout_marginEnd="@dimen/layout_margin_medium"
1717
android:layout_marginRight="@dimen/layout_margin_medium"
18-
android:layout_marginBottom="@dimen/layout_margin_large"
19-
app:layout_constraintBottom_toTopOf="@+id/currentLocationLinearLayout"
18+
android:inputType="textCapWords"
19+
app:iconifiedByDefault="false"
2020
app:layout_constraintEnd_toEndOf="parent"
2121
app:layout_constraintStart_toStartOf="parent"
22-
app:layout_constraintTop_toTopOf="parent">
23-
24-
</FrameLayout>
22+
app:layout_constraintTop_toTopOf="parent"
23+
app:queryHint="@string/location_hint"
24+
app:searchIcon="@null" />
2525

2626
<LinearLayout
2727
android:id="@+id/currentLocationLinearLayout"

0 commit comments

Comments
 (0)