Skip to content

Develop Bulletin sdk#1

Open
WazirxDax wants to merge 14 commits into
developfrom
develop_sdk
Open

Develop Bulletin sdk#1
WazirxDax wants to merge 14 commits into
developfrom
develop_sdk

Conversation

@WazirxDax
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread app/build.gradle
@@ -0,0 +1,69 @@
plugins {
id 'com.android.application'
Copy link
Copy Markdown

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

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


} No newline at end of file
Copy link
Copy Markdown

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.

Comment thread app/src/main/AndroidManifest.xml Outdated
</activity>
</application>

</manifest> No newline at end of file
Copy link
Copy Markdown

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
}

} No newline at end of file
Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown
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.

Comment thread app/src/main/AndroidManifest.xml Outdated
android:theme="@style/Theme.Bulletin"
tools:targetApi="31">
<activity
android:name=".MainActivity"
Copy link
Copy Markdown

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
Copy Markdown
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
}

} No newline at end of file
Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown
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
Copy Markdown

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