This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2023 Marlonlom | |
* | |
* Licensed to the Apache Software Foundation (ASF) under one | |
* or more contributor license agreements. See the NOTICE file | |
* distributed with this work for additional information | |
* regarding copyright ownership. The ASF licenses this file | |
* to you under the Apache License, Version 2.0 (the | |
* "License"); you may not use this file except in compliance | |
* with the License. You may obtain a copy of the License at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2023 marlonlom | |
* | |
* Licensed to the Apache Software Foundation (ASF) under one | |
* or more contributor license agreements. See the NOTICE file | |
* distributed with this work for additional information | |
* regarding copyright ownership. The ASF licenses this file | |
* to you under the Apache License, Version 2.0 (the | |
* "License"); you may not use this file except in compliance | |
* with the License. You may obtain a copy of the License at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright (C) 2019 Fernando Cejas Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('date-diff', () => { | |
it('Should check if no date diff results shown for comparing exact same dates', () => { | |
const date0 = new Date('2020-11-01T01:00:00'); | |
const date1 = new Date('2020-11-01T01:00:00'); | |
const expectedResult = { | |
millennium: 0, | |
century: 0, | |
decade: 0, | |
year: 0, | |
quarter: 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const japaneseName= (name) => { | |
const dictionary = {"a": "ka","b": "tu","c": "mi","d": "te","e": "ku","f": "lu","g": "ji","h": "ri","i": "ki","j": "zu","k": "me","l": "ta","m": "rin","n": "to","o": "mo","p": "no","q": "ke","r": "shi","s": "ari","t": "chi","u": "do","v": "ru","w": "na","x": "mei","y": "fu","z": "ra"}; | |
return name.substring(0, name.indexOf(' ') >=0 ? name.indexOf(' ') : name.length).replace(/[a-z]/gi, m => dictionary[m]); | |
} |
Activity Result API is a new set of classes that enhances the way we use the recently deprecated methods startActivityForResult and onActivityResult, thats a usual way for interact with another apps using intents and a response code for checking the result data.
In this short post, i'm sharing to you how adapt the firebase auth flow using the Activity Result APIs
Activity Result APIs are available since AndroidX Activity 1.2.0-alpha02 and Fragment 1.3.0-alpha02. Remember to use -ktx artifacts to get additional extensions that helps you write cleaner Kotlin code.
(app/build.gradle)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.text.SimpleDateFormat | |
import java.util.Date | |
import java.util.Locale.ENGLISH | |
/** | |
* Creates a "collapsed" date range String representing the period of time | |
* between two Dates. | |
* | |
* @author marlonlom | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2015 Jared Rummler <[email protected]> | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by Rany Albeg Wein on 07/11/2015. | |
* Since we currently don't have a LongItemClick listener for the {@link RecyclerView} | |
* this is an implementation that uses a {@link GestureDetector} to notify us for long click events on one of | |
* {@link RecyclerView}'s child views. It also handles single-tap-up ( a click ) and a double-click on a child view. | |
*/ | |
public class RecyclerViewItemTouchListener extends RecyclerView.SimpleOnItemTouchListener { | |
/** | |
* A listener that will be invoked on item click events. |
NewerOlder