Tuesday, January 14, 2020

How to Make Blinking TextView Android

Good day guys, It's the second of week on 2020 year. We need a good boost to start every day to do something good way. I listened to many new songs and old song too. It's good to refresh my brain to think. Creating an new article every week it's not easy though. I need a problem to solve haha. Maybe I will share what game that I am playing on the next article.

We can see how many visitor in our blog, for me it's not much people see my posts. But I'm gratefully my post will last long because it stands on Blogger. We know blogger it's so long, and I hope it will be better for the future.

So the article for now, it's about TextView Android. I have an app called To Do List. There's a fragment calendar where you can click the day and you will be directed to the date in list view fragment task lists. So it's very helpful for users to choose where they want to see data according to date. Like images above what I mean about.

For making user friendly app. I give a little bit animation blink, so user will notice where the date of header position. The code for this animation, it's simple. It's just a few lines. So don't expect it's too hard to try. You can customize this animation according to your app wanna be.

This is the code guys.

Tuesday, January 7, 2020

Avoid Whatsapp Share Only Text in UIActivityViewController

Hello guys, this is a good day to start a new resolution because. It's still fresh 2020, we can start doing something new or something that we want to complete when this year ends. I hope I can always write a new article every week with good quality. Thanks for support to be consistence it's hard and easy to do if you are in perservence mode.

If you ever have installed app called instagram or others social media, you will find a share feature. where you can share your photo to others app. Like email, notes or social media. Fortunately iOS provide the feature to share called UIActivityViewController. So it's like we use library in iOS, we just create our text or photo sending to UIActivityViewController. Then it will create share feature like above.

But I have a problem when trying to share on Whatsapp. It just showed text when I sent image and text. Unfortunely Whatsapp only support image or text, not both of them. So we need to choose what's gonna we share. In my case I need to share image without text, so how do I check when the user share on whatsapp spesificaly.

So I created two classes for each items. SocialActivityItem and TextActivityitem, SocialActivityItem for sharing image and TextActivityitem for sharing text. It will extent UIActivityItemSource so in order to be used in activityItems. If you're confused with what I'm talking about, I will provide the code for you guys. Sorry I'm not expert to explain something :D.

So this is the code guys.

Tuesday, December 31, 2019

Solution Force Close When Save Image in UIActivityViewController Swift 5 iOS 13

Hello guys, It's last week for this year. And it feels so fast for me. I have started to be more consistent on this year. I started to post once every week, it's not hard for people have much time. But for me to think about what's next article need more time. I have to have a problem to make a solution haha. Tommorow will be on first day of 2020 year. It's nice to know 2019. And good bye 2019 haha.

So now the problem I faced when I was trying to save image through UIActivityViewController. After saving image the current view controller will dismiss. And it's a bug from iOS, it's confirmed on the internet stackoverflow that I give link on below. Many people faced it before me haha, thanks I know it late so that I don't need to figure it be myself haha. I hope this bug will soon be fixed by Apple. How can this bug didn't happened on iOS 12 but happed on iOS 13. I think it's because iOS 13 introduced new feature modal presentation.

We need to avoid dismissing view controller. Fortunetly I found good solution on the internet, we need to create transparant view controller and it looks clean when the current view will be dismissed. And we need to set transparant in storyboard like screenshoot above. It's simple to do, right ? then follow coding below. It's very important to understand this code to avoid error in the future.

I set background color to Clear Color. So that it will look transparant behind UIActivityViewController. And as if there's no ViewController behind it. So basically it looks same with or without Transparant view controller.

This is the code that I got :

Monday, December 23, 2019

Missing system image Android Studio solution

Happy holidays guys, this is december with long weekend haha. I still have a problem with Android Studio. After I update my emulator and suddenly I got a issue that is so weird. You can see picture above I need to redownload emulator from android studio.

If you got a issue like me, don't worry and don't uninstall your android studio. It's not complicated to resolve it. You just need to redownload the emulator go to Tools -> AVD Manager. You can see the issue of your emulator and redownload or resolve it. And you will be like image above.

Just wait the download and your emulator will be fine again. If you still have the issue, please comment below and let me know what's the problem. I'm happy if i can help you guys. I'm not expert but it's fun when i can solve programming issues.

Wednesday, December 18, 2019

How to have ConstraintLayout inside ScrollView and ScrollView inside ConstraintLayout Android

Hai guys, last week I found a unique way to create layout Android look. You can see the title, that's actually what I want. I know it sounds weird but sometimes we need to create something that we might curious if it's in o n the internet or not.

Why I'm using ConstraintLayout because it's almost same with iOS xcode. There is constraint where you can set top constraint, bottom constraint, left constraint and right constraint. So it's easy for me to design like what I want. But it's personal, it depends on you too.

And fortunely you can combine ScrollView and ConstraintLayout. Because you need to worry when the height of your layout is high than real device height. And if you don't use UIScrollview your component will be unseen when the height of device is more small than layout that we design.

Like my app, I want to use ConstraintLayout and ScrollView together. Maybe it can do with RelativeLayout or others layout. But something special that I want is still using the ConstraintLayout. Because this is the layout that i like. It can be customized through Android Studio without we have to code by our own.