Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
denny0223 committed Feb 24, 2024
2 parents 673c866 + 0cf437c commit fb71fb1
Show file tree
Hide file tree
Showing 30 changed files with 436 additions and 314 deletions.
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
# CCIP-Android aka OPass

This repo is CCIP(Community Checkin with Interactivity Project) Android client, OPass is the app name, you can [download it from Google Play](https://play.google.com/store/apps/details?id=app.opass.ccip).
CCIP (Community Checkin with Interactivity Project) a.k.a OPass, is Taiwan's FLOSS conference check-in
solution and provides newest event information for audience. This repository hosts the source code for
its Android app. OPass helps users to check-in rapidly and provide the newest information about the conference.

OPass is Taiwan's FLOSS conference check-in solution and provides newest event information for audience.
<a href='https://play.google.com/store/apps/details?id=app.opass.ccip'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png' height="20%" width="20%" /></a>

It has been used in [SITCON (Students' Information Technology Conference)](https://sitcon.org/) & [COSCUP (Conference for Open Source Coders, Users and Promoters)](https://coscup.org/) for so many years. This app will help you check in rapidly and provide the newest information about the conference.
# Usage

Some of the conferences in which OPass has been in use for the past few years are:

Patch welcome!
- [SITCON (Students' Information Technology Conference)](https://sitcon.org/)
- [COSCUP (Conference for Open Source Coders, Users and Promoters)](https://coscup.org/)

## Development

# [Download From Google Play](https://play.google.com/store/apps/details?id=app.opass.ccip)
- OPass is licensed and distributed under the GNU GENERAL PUBLIC LICENSE v3
- List of contributors can be viewed on this repository's [contributors graph](https://github.com/CCIP-App/CCIP-Android/graphs/contributors).

In case you wish to contribute to the development of this project, feel free to open a [Pull Request](https://github.com/CCIP-App/CCIP-Android/pulls)
or an [Issue](https://github.com/CCIP-App/CCIP-Android/issues) for the same. Contributions are always welcome.
97 changes: 0 additions & 97 deletions app/build.gradle

This file was deleted.

98 changes: 98 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.gms.google-services")
}

android {
namespace = "app.opass.ccip"
compileSdk = 34

defaultConfig {
applicationId = "app.opass.ccip"
minSdk = 24
targetSdk = 34
versionCode = 54
versionName = "3.4.0"

manifestPlaceholders["manifestApplicationId"] = "$applicationId"
}

buildFeatures {
buildConfig = true
viewBinding = true
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android.txt"),
"proguard-rules.pro"
)
}
}
packaging {
resources {
excludes += listOf("META-INF/atomicfu.kotlin_module")
}
}


compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}

lint {
lintConfig = file("lint.xml")
}

androidResources {
generateLocaleConfig = true
}
}

dependencies {

implementation("com.google.firebase:firebase-analytics-ktx:21.5.0")
implementation("com.onesignal:OneSignal:[4.0.0, 4.99.99]")

implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.11.0")
implementation("androidx.recyclerview:recyclerview:1.3.2")
implementation("androidx.cardview:cardview:1.0.0")
implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.fragment:fragment-ktx:1.6.2")
implementation("androidx.viewpager2:viewpager2:1.0.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("com.google.android.flexbox:flexbox:3.0.0")
implementation("com.google.code.gson:gson:2.10.1")
implementation("com.squareup.okhttp3:okhttp:4.12.0")
implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("com.squareup.retrofit2:converter-gson:2.9.0")

implementation("com.journeyapps:zxing-android-embedded:4.3.0")

// Coil
implementation("io.coil-kt:coil:2.5.0")

// Coroutines
val coroutinesVersion = "1.7.3"
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion")

// Lifecycle
val lifecycleVersion = "2.7.0"
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion")

// Markwon
val markwonVersion = "4.6.2"
implementation("io.noties.markwon:core:$markwonVersion")
implementation("io.noties.markwon:linkify:$markwonVersion")
}
2 changes: 1 addition & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# By default, the flags in this file are appended to flags specified
# in /home/denny/.android-sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
# directive in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/app/opass/ccip/ui/DrawerMenuAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import app.opass.ccip.R
import app.opass.ccip.model.Feature
import app.opass.ccip.model.FeatureType
import app.opass.ccip.ui.DrawerMenuViewHolder.*
import com.squareup.picasso.Picasso
import coil.load

class DrawerMenuAdapter(
private val context: Context,
Expand Down Expand Up @@ -78,7 +78,7 @@ class DrawerMenuAdapter(
launchIconView?.isGone = !item.shouldShowLaunchIcon
if (item.iconDrawable != null) return iconView.setImageDrawable(getDrawable(item.iconDrawable))
iconView.setImageDrawable(null)
Picasso.get().load(feature.icon).into(iconView)
iconView.load(feature.icon)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/app/opass/ccip/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ import app.opass.ccip.ui.schedule.ScheduleTabFragment
import app.opass.ccip.util.CryptoUtil
import app.opass.ccip.util.PreferenceUtil
import app.opass.ccip.util.WifiUtil
import coil.load
import com.google.android.material.navigation.NavigationView
import com.google.android.material.snackbar.Snackbar
import com.squareup.picasso.Picasso
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
Expand Down Expand Up @@ -240,7 +240,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
private fun buildDrawer() {
val event = PreferenceUtil.getCurrentEvent(this)

Picasso.get().load(event.logoUrl).into(confLogoImageView)
confLogoImageView.load(event.logoUrl)

val role = PreferenceUtil.getRole(this)
val filteredFeatures = event.features.filter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class AnnouncementAdapter(private val mContext: Context, private val announcemen
private val mBackground = mTypedValue.resourceId

init {
mContext.theme.resolveAttribute(R.attr.selectableItemBackground, mTypedValue, true)
mContext.theme.resolveAttribute(android.R.attr.selectableItemBackground, mTypedValue, true)
}

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
package app.opass.ccip.ui.auth

import android.content.Intent
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.text.buildSpannedString
import app.opass.ccip.R
import app.opass.ccip.databinding.FragmentMethodSelectionBinding
import app.opass.ccip.databinding.IncludeAuthHeaderBinding
import app.opass.ccip.extension.clickable
import app.opass.ccip.extension.isInverted
import app.opass.ccip.ui.event.EventActivity
import app.opass.ccip.util.PreferenceUtil
import com.squareup.picasso.Picasso
import me.saket.bettermovementmethod.BetterLinkMovementMethod
import coil.load

class MethodSelectionFragment : AuthActivity.PageFragment() {
private val mActivity: AuthActivity by lazy { requireActivity() as AuthActivity }
Expand All @@ -32,19 +31,15 @@ class MethodSelectionFragment : AuthActivity.PageFragment() {
.setOnClickListener { sendResult(AuthActivity.AuthMethod.ENTER_TOKEN) }

val header = IncludeAuthHeaderBinding.bind(binding.root)
val built = buildSpannedString {
clickable(mActivity::switchEvent) {
append(getString(R.string.not_this_event))
}
header.notThisEvent.setOnClickListener {
startActivity(Intent(requireContext(), EventActivity::class.java))
}
header.notThisEvent.text = built
header.notThisEvent.movementMethod = BetterLinkMovementMethod.getInstance()

val context = requireContext()
val event = PreferenceUtil.getCurrentEvent(context)
header.confName.text = event.displayName.findBestMatch(context)
header.confLogo.isInverted = true
Picasso.get().load(event.logoUrl).into(header.confLogo)
header.confLogo.load(event.logoUrl)

return binding.root
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import app.opass.ccip.extension.getFastPassUrl
import app.opass.ccip.extension.isInverted
import app.opass.ccip.network.CCIPClient
import app.opass.ccip.util.PreferenceUtil
import coil.load
import com.onesignal.OneSignal
import com.squareup.picasso.Picasso
import kotlinx.coroutines.launch
import org.json.JSONException
import org.json.JSONObject
Expand Down Expand Up @@ -134,7 +134,7 @@ class TokenCheckFragment : AuthActivity.PageFragment() {
val event = PreferenceUtil.getCurrentEvent(context)
header.confName.text = event.displayName.findBestMatch(context)
header.confLogo.isInverted = true
Picasso.get().load(event.logoUrl).into(header.confLogo)
header.confLogo.load(event.logoUrl)
}

override fun onDestroyView() {
Expand Down
17 changes: 6 additions & 11 deletions app/src/main/java/app/opass/ccip/ui/auth/TokenEntryFragment.kt
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
package app.opass.ccip.ui.auth

import android.content.Intent
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.inputmethod.EditorInfo
import android.widget.TextView
import androidx.core.text.buildSpannedString
import app.opass.ccip.R
import app.opass.ccip.databinding.FragmentTokenEntryBinding
import app.opass.ccip.databinding.IncludeAuthHeaderBinding
import app.opass.ccip.extension.clickable
import app.opass.ccip.extension.focusAndShowKeyboard
import app.opass.ccip.extension.isInverted
import app.opass.ccip.ui.event.EventActivity
import app.opass.ccip.util.PreferenceUtil
import com.squareup.picasso.Picasso
import me.saket.bettermovementmethod.BetterLinkMovementMethod
import coil.load

class TokenEntryFragment : AuthActivity.PageFragment() {
private val mActivity: AuthActivity by lazy { requireActivity() as AuthActivity }
Expand All @@ -42,19 +41,15 @@ class TokenEntryFragment : AuthActivity.PageFragment() {
false
})
val header = IncludeAuthHeaderBinding.bind(binding.root)
val built = buildSpannedString {
clickable(mActivity::switchEvent) {
append(getString(R.string.not_this_event))
}
header.notThisEvent.setOnClickListener {
startActivity(Intent(requireContext(), EventActivity::class.java))
}
header.notThisEvent.text = built
header.notThisEvent.movementMethod = BetterLinkMovementMethod.newInstance()

val context = requireContext()
val event = PreferenceUtil.getCurrentEvent(context)
header.confName.text = event.displayName.findBestMatch(context)
header.confLogo.isInverted = true
Picasso.get().load(event.logoUrl).into(header.confLogo)
header.confLogo.load(event.logoUrl)
}

override fun onDestroyView() {
Expand Down
Loading

0 comments on commit fb71fb1

Please sign in to comment.