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

Develop Bulletin sdk #1

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from
Open

Develop Bulletin sdk #1

wants to merge 14 commits into from

Conversation

WazirxDax
Copy link
Contributor

No description provided.

@@ -0,0 +1,69 @@
plugins {
id 'com.android.application'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be an application. This needs to be configured as a library.
Refer to https://github.com/Codigami/CFAlertDialog/blob/master/cfalertdialog/build.gradle

app/build.gradle Outdated
kapt 'com.github.bumptech.glide:compiler:4.13.2'


}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New line. Add this to all the new files.

</activity>
</application>

</manifest>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New line

gsonInstance = GsonHelper.gsonInstance
}

}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New line

import com.bulletin.utilities.GsonHelper
import com.google.gson.Gson

class BulletinApp : Application() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Application class is not required for this.
Wherever context is required it needs to be passed in as parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have same thinking but we need to discuss.

android:theme="@style/Theme.Bulletin"
tools:targetApi="31">
<activity
android:name=".MainActivity"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this activity.
Do not use Launcher category. Should be a default activity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then how we can run the project?

return true
}

}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New line

import com.bulletin.utilities.VersionUtil
import java.util.*

//object BulletinDataStore {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove commented code.

import com.example.bulletin.databinding.ActivityMainBinding
import com.wrx.wazirx.views.bulletin.model.Media

class MainActivity : AppCompatActivity(), FormRecyclerViewAdapter.OnItemClickListener {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this activity to a better name

binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)

binding.listView.setBackgroundColor(ThemeUtils.getAttributedColor(R.attr.main_bg_surface_alt, binding.listView.context))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using our colors in this library..?
We should be configuring this from the main app right..?

}

fun setUpItems() : ArrayList<BulletinItem> {
// val bulletinItem = PreTitle("text")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove commented code


fun updateAppearance() {

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract this condition into an extension.

// val items = BulletinSdk().showUnseenBulletin(4)


val title = Title("Version " + "1.21","In this update","loreum ipsum loreum ipsum loreum ipsum loreum ipsum loreum ipsum")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the hardcoded data.

}

fun Any.saveToStorage(key: Any) {
// AppStorageHelper.save(key, this)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this method required..?

package com.bulletin.extension


fun String.isNumeric(): Boolean {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These methods can be combined with StringExtensions.kt

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will discuss

@@ -0,0 +1,79 @@
package com.bulletin.models

data class BulletPoint(var bullet: Bullet?, var titleText: String?, var subTitleText: String?) : BulletinItem() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to discuss this implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants