-
Notifications
You must be signed in to change notification settings - Fork 305
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
Home screen widget #100
base: master
Are you sure you want to change the base?
Home screen widget #100
Conversation
@ericbrandwein Can you rebase this patch? Thanks! |
781c71e
to
b2c799a
Compare
Done! If you want to change something about the widget, please let me know, or merge this to a temporary branch and edit it from there. |
Something I'd love is the ability like on the phone app where you can drag a shortcut for dialing a specific user, I'd love to be able to drag a specific shortcut for a particular code onto the home screen, where I can then click it and it will just pop up a notification with my code. |
@ericbrandwein This PR causes one of our tests to fail. Can you please address that? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You PR is quite good, I've made some comments you should consider before being merged.
import android.widget.Toast; | ||
|
||
/** | ||
* Created by root on 18/04/17. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are not root
of this project 😄
import java.util.Set; | ||
|
||
/** | ||
* Created by root on 17/04/17. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are not root again.
import java.io.IOException; | ||
|
||
/** | ||
* Created by root on 13/04/17. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
root
again
final RemoteViews row = new RemoteViews(context.getPackageName(), R.layout.widget_row); | ||
|
||
try { | ||
Bitmap b = Picasso.with(context).load(token.getImage()).get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This not how to use Picasso. Calling .get()
will block the thread instead of taking advantage of assynchronous call of Picasso.
You may:
- use
.error(R.drawable.logo)
to handle the error (don't use try-catch when Picassso does it for you) - use
.into(row, R.id.widget_image, ...)
to put the loaded image in the imageview
android:layout_gravity="center_vertical" | ||
android:textColor="@android:color/white" | ||
android:layout_height="wrap_content" | ||
android:text="@string/app_name"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use drawableLeft directly in TextView instead of Linear+ImageView+TextView to draw a drawable on the left ?
Adds a widget that shows a list of the current tokens. I saw this feature in the Authy app and I liked it, so I decided to add it here.
Fixes #26.