Skip to content

Commit

Permalink
Merge branch 'master' into 2748-crash-iorealmexceptionsrealmexception…
Browse files Browse the repository at this point in the history
…-at-playstore-auto-test
  • Loading branch information
dogi authored Nov 30, 2023
2 parents 773a572 + 3cb7a2b commit e65122e
Show file tree
Hide file tree
Showing 9 changed files with 153 additions and 152 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: setup JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/android-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
expose-version-code: 'true'

- name: setup JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ dependencies {
implementation "com.github.VaibhavLakhera:Circular-Progress-View:0.1.2"
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation 'com.applandeo:material-calendar-view:1.9.0'
implementation "androidx.work:work-runtime:2.8.1"
implementation "androidx.work:work-runtime:2.9.0"
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.9.21"))
}
realm {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
package org.ole.planet.myplanet.model

import com.google.gson.JsonObject
import io.realm.Realm
import io.realm.RealmObject
import io.realm.annotations.PrimaryKey
import org.ole.planet.myplanet.utilities.NetworkUtils
import java.util.Date
import java.util.UUID

open class RealmCourseActivity : RealmObject() {
@PrimaryKey
private var _id: String? = null
@JvmField
var createdOn: String? = null
private var _rev: String? = null
@JvmField
var time: Long = 0
@JvmField
var title: String? = null
@JvmField
var courseId: String? = null
@JvmField
var parentCode: String? = null
@JvmField
var type: String? = null
@JvmField
var user: String? = null
fun get_rev(): String? {
return _rev
}

fun set_rev(_rev: String?) {
this._rev = _rev
}

fun get_id(): String? {
return _id
}

fun set_id(_id: String?) {
this._id = _id
}

companion object {
@JvmStatic
fun createActivity(realm: Realm, userModel: RealmUserModel, course: RealmMyCourse) {
if (!realm.isInTransaction) realm.beginTransaction()
val activity = realm.createObject(
RealmCourseActivity::class.java, UUID.randomUUID().toString()
)
activity.type = "visit"
activity.title = course.courseTitle
activity.courseId = course.courseId
activity.time = Date().time
activity.parentCode = userModel.parentCode
activity.createdOn = userModel.planetCode
activity.createdOn = userModel.planetCode
activity.user = userModel.name
realm.commitTransaction()
}

@JvmStatic
fun serializeSerialize(realm_courseActivities: RealmCourseActivity): JsonObject {
val ob = JsonObject()
ob.addProperty("user", realm_courseActivities.user)
ob.addProperty("courseId", realm_courseActivities.courseId)
ob.addProperty("type", realm_courseActivities.type)
ob.addProperty("title", realm_courseActivities.title)
ob.addProperty("time", realm_courseActivities.time)
ob.addProperty("createdOn", realm_courseActivities.createdOn)
ob.addProperty("parentCode", realm_courseActivities.parentCode)
ob.addProperty("androidId", NetworkUtils.getUniqueIdentifier())
ob.addProperty("deviceName", NetworkUtils.getDeviceName())
return ob
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@
import java.util.List;

public class LoginActivity extends SyncActivity {
private Button openCommunity, btnFeedback;
private boolean guest = false;
private TextView tvAvailableSpace, previouslyLoggedIn;
private TextView previouslyLoggedIn;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ public abstract class SyncActivity extends ProcessUserDataActivity implements Sy
View positiveAction;
String processedUrl;
boolean isSync = false, forceSync = false;
Button btnSignIn, becomeMember, btnGuestLogin, btnLang;
TextView customDeviceName, lblVersion;
Button btnSignIn, becomeMember, btnGuestLogin, btnLang, openCommunity, btnFeedback;
TextView customDeviceName, lblVersion, tvAvailableSpace;
SharedPreferences defaultPref;
ImageButton imgBtnSetting;
SwitchCompat switchChildMode;
Expand Down Expand Up @@ -377,8 +377,9 @@ public void declareElements() {
if (!defaultPref.contains("beta_addImageToMessage")) {
defaultPref.edit().putBoolean("beta_addImageToMessage", true).commit();
}
customDeviceName.setText(getCustomDeviceName());

if (!prefData.getTEAMMODE1()){
customDeviceName.setText(getCustomDeviceName());
switchChildMode.setChecked(settings.getBoolean("isChild", false));
switchChildMode.setOnCheckedChangeListener((compoundButton, b) -> {
inputName.setText("");
Expand Down Expand Up @@ -436,9 +437,9 @@ public void declareMoreElements() {
}
return false;
});
if (!prefData.getTEAMMODE1()) {
setUplanguageButton();
}

setUplanguageButton();

if (defaultPref.getBoolean("saveUsernameAndPassword", false)) {
inputName.setText(settings.getString(getString(R.string.login_user), ""));
inputPassword.setText(settings.getString(getString(R.string.login_password), ""));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import org.ole.planet.myplanet.model.User
import org.ole.planet.myplanet.ui.community.HomeCommunityDialogFragment
import org.ole.planet.myplanet.ui.feedback.FeedbackFragment
import org.ole.planet.myplanet.ui.userprofile.TeamListAdapter
import org.ole.planet.myplanet.utilities.FileUtils
import org.ole.planet.myplanet.utilities.Utilities

class TeamLoginActivity : SyncActivity(), TeamListAdapter.OnItemClickListener {
Expand All @@ -40,8 +41,15 @@ class TeamLoginActivity : SyncActivity(), TeamListAdapter.OnItemClickListener {
imgBtnSetting = activityTeamLoginBinding.imgBtnSetting
syncIcon = activityTeamLoginBinding.syncIcon
lblVersion = activityTeamLoginBinding.lblVersion
btnLang = activityTeamLoginBinding.btnLang
tvAvailableSpace = activityTeamLoginBinding.tvAvailableSpace
openCommunity = activityTeamLoginBinding.openCommunity
btnFeedback = activityTeamLoginBinding.btnFeedback
customDeviceName = activityTeamLoginBinding.customDeviceName

service = Service(this)

tvAvailableSpace.text = FileUtils.getAvailableOverTotalMemoryFormattedString()
changeLogoColor()
declareElements()
declareMoreElements()
Expand All @@ -65,15 +73,15 @@ class TeamLoginActivity : SyncActivity(), TeamListAdapter.OnItemClickListener {
forceSyncTrigger()

if (Utilities.getUrl().isNotEmpty()) {
activityTeamLoginBinding.openCommunity.visibility = View.VISIBLE
activityTeamLoginBinding.openCommunity.setOnClickListener {
openCommunity.visibility = View.VISIBLE
openCommunity.setOnClickListener {
HomeCommunityDialogFragment().show(supportFragmentManager, "")
}
HomeCommunityDialogFragment().show(supportFragmentManager, "")
} else {
activityTeamLoginBinding.openCommunity.visibility = View.GONE
openCommunity.visibility = View.GONE
}
activityTeamLoginBinding.btnFeedback.setOnClickListener {
btnFeedback.setOnClickListener {
FeedbackFragment().show(supportFragmentManager, "")
}

Expand Down Expand Up @@ -130,7 +138,7 @@ class TeamLoginActivity : SyncActivity(), TeamListAdapter.OnItemClickListener {
.error(R.drawable.profile)
.into(activityTeamLoginBinding.userProfile)

activityTeamLoginBinding.inputName.setText(user.name)
inputName.setText(user.name)
} else {
if (user.source == "guest"){
val model = mRealm.copyFromRealm(RealmUserModel.createGuestUser(user.name, mRealm, settings))
Expand Down
Loading

0 comments on commit e65122e

Please sign in to comment.