Git Product home page Git Product logo

horizontalpicker's People

Contributors

anaistroncoso avatar dabarnard avatar demogorgorn avatar jhonnypapinotas avatar jhonnyx2012 avatar milosmns avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

horizontalpicker's Issues

Issue while using on Kotlin

I m getting following issue after selecting a date

                                                             java.lang.NullPointerException: Attempt to invoke virtual method 'void devs.mulham.horizontalcalendar.utils.HorizontalCalendarListener.onDateSelected(java.util.Calendar, int)' on a null object reference
                                                                 at devs.mulham.horizontalcalendar.utils.HorizontalSnapHelper.notifyCalendarListener(HorizontalSnapHelper.java:46)
                                                                 at devs.mulham.horizontalcalendar.utils.HorizontalSnapHelper.findSnapView(HorizontalSnapHelper.java:37)
                                                                 at android.support.v7.widget.SnapHelper.snapToTargetExistingView(SnapHelper.java:191)
                                                                 at android.support.v7.widget.SnapHelper$1.onScrollStateChanged(SnapHelper.java:53)
                                                                 at android.support.v7.widget.RecyclerView.dispatchOnScrollStateChanged(RecyclerView.java:4759)
                                                                 at android.support.v7.widget.RecyclerView.setScrollState(RecyclerView.java:1434)
                                                                 at android.support.v7.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:4908)
                                                                 at android.view.Choreographer$CallbackRecord.run(Choreographer.java:773)
                                                                 at android.view.Choreographer.doCallbacks(Choreographer.java:586)
                                                                 at android.view.Choreographer.doFrame(Choreographer.java:555)
                                                                 at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:759)
                                                                 at android.os.Handler.handleCallback(Handler.java:739)
                                                                 at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                 at android.os.Looper.loop(Looper.java:135)
                                                                 at android.app.ActivityThread.main(ActivityThread.java:5422)
                                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                                 at java.lang.reflect.Method.invoke(Method.java:372)
                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:914)
                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:707)

Change DEFAULT_DAYS_TO_PLUS

Hello

In your description we have: Configurable number of generated days (default: 120).

How can chage this value?

Need some information +possible bug.

I want to be able to deselect programmatically, is this possible today?

A other thing is that you cannot select first day of the calendar if its the first thing you want to select. Is that normal?

View Previous Months/Dates

Is there any way to configure the datepicker so that you can scroll through past months/dates? Right now, mine starts on the current month and lets you scroll forward but not back, however, I need to make it so that you can scroll back and look at entries made on earlier dates.

Bad appearance in dialog

Picker looks not the way it should in my dialog. Have no idea why. Hope you'll see this message and try to solve it.
fczycrm8fka

MainActivity.class

package tyan.hainee.datepicker;

import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.github.jhonnyx2012.horizontalpicker.HorizontalPicker;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        View dialogView = getLayoutInflater().inflate(R.layout.dialog, null);

        HorizontalPicker dialogPicker = (HorizontalPicker) dialogView.findViewById(R.id.date_picker);
        dialogPicker.init();

        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setView(dialogView);
        final AlertDialog dialog = builder.create();

        findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                dialog.show();
            }
        });
    }
}

activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="tyan.hainee.datepicker.MainActivity"
    android:orientation="vertical"
    android:padding="16dp">

    <Button
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="DIALOG"/>
</LinearLayout>

dialog.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:padding="16dp"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <com.github.jhonnyx2012.horizontalpicker.HorizontalPicker
        android:id="@+id/date_picker"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

</LinearLayout>

styles.xml

<resources>
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>
</resources>

Can you explain how it works setDays and setOffset?

In my case, I need to set currentDate as endDate and total no. of days are 14.

So as per today, 16-03-2019 is last date (end date) and 02-03-2019 will be starting date.

I think it will be done using setDays with setOffset.

Can you please elaborate how it works?

Remove allowBackup from manifest

Hi @jhonnyx2012 , thanks for your efforts with this library. It's been very helpful and I haven't found any other library that works as well as yours. I came across the following issue whilst using your lib and thought I would share some info:

If the library is used by any app which sets the value for allowBackup to false within their manifest, the manifest merger will fail with an error similar to the one below:

Manifest merger failed : Attribute application@allowBackup value=(false) from AndroidManifest.xml:10:9-36 is also present at [com.github.jhonnyx2012:horizontal-picker:1.0.6] AndroidManifest.xml:12:9-35 value=(true). Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:8:5-63:19 to override.

I believe by simply removing the android:allowBackup part at this line it would fix this issue. I will see if I can create a PR for this, but thought I would create the issue in the meantime until I get around to it.

This article gives some more background

Gradle 7 & JCenter

It doesn't seem to be possible to use this with Gradle 7 and Jcentre being depreciated.

Internationalization

Dude this needs to be in English, it's great. Can you do it yourself? I can help with that if you need it :)

Also, 'horizontal picker' is not really a good name, it might collide with other number pickers (trust me, I know) - consider changing to horizontal 'date' picker.

Cheers

Unable to change colors

Besides the background color, whenever I try changing the color of any of the entities, it still remains default grey. Below is the code.

picker
.setListener(this)
.setDateSelectedColor(Color.WHITE)
.setDateSelectedTextColor(Color.WHITE)
.setMonthAndYearTextColor(Color.WHITE)
.setTodayDateBackgroundColor(Color.GRAY)
.setUnselectedDayTextColor(Color.WHITE)
.setDayOfWeekTextColor(Color.WHITE)
.setUnselectedDayTextColor(Color.WHITE)
.init();

Any suggestions?

visibility gone and hide issue.

visibility gone and visible is not working. when i set visibility visible of picker it show unrecognized string instead of showing dates. can you fix it immediately??

setDate() not working as expected

This date picker is great. But I encounter an issue below, hope someone can advise:
I initialise the picker with days=7, offset=0, then select a date by default via setDate() function. But no matter what date I set, it's always set to the date in the middle of that 7 days, not the date I wanted to set. Is this the intended behaviour?

DatePickerListener

Error-
Inconvertible types; cannot cast 'anonymous android.view.View.OnClickListener' to 'com.github.jhonnyx2012.horizontalpicker.DatePickerListener'

when I click alt+ enter it gives
-Introduce Local Variable
-merge sequential method calls into call chain

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.