{"action":"created","issue":{"url":"https://api.github.com/repos/stepstone-tech/android-material-stepper/issues/35","repository_url":"https://api.github.com/repos/stepstone-tech/android-material-stepper","labels_url":"https://api.github.com/repos/stepstone-tech/android-material-stepper/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/stepstone-tech/android-material-stepper/issues/35/comments","events_url":"https://api.github.com/repos/stepstone-tech/android-material-stepper/issues/35/events","html_url":"https://github.com/stepstone-tech/android-material-stepper/issues/35","id":195538166,"number":35,"title":"Strange issue in createStep","user":{"login":"jagan999","id":16652714,"avatar_url":"https://avatars.githubusercontent.com/u/16652714?v=3","gravatar_id":"","url":"https://api.github.com/users/jagan999","html_url":"https://github.com/jagan999","followers_url":"https://api.github.com/users/jagan999/followers","following_url":"https://api.github.com/users/jagan999/following{/other_user}","gists_url":"https://api.github.com/users/jagan999/gists{/gist_id}","starred_url":"https://api.github.com/users/jagan999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jagan999/subscriptions","organizations_url":"https://api.github.com/users/jagan999/orgs","repos_url":"https://api.github.com/users/jagan999/repos","events_url":"https://api.github.com/users/jagan999/events{/privacy}","received_events_url":"https://api.github.com/users/jagan999/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-12-14T14:01:34Z","updated_at":"2016-12-19T13:55:32Z","closed_at":null,"body":"I love your stepper but am now stumped with an issue. Here's how I am using your library and where I am getting stumped. \r\n\r\nI have 7 steps in my wizard, each implemented by a Fragment that extends Step. In the overridden createStep method, I have this code.\r\n\r\n        @Override\r\n        public Fragment createStep(int position) {\r\n            Logger.writeToLog(\"position=\" + position);\r\n            switch (position) {\r\n                case 0:\r\n                    return new StepWelcome();\r\n                case 1:\r\n                    return new StepSelectAccounts();\r\n                case 2:\r\n                    return new StepPreTaxEarnings();\r\n                case 3:\r\n                    return new StepTaxes();\r\n                case 4:\r\n                    return new StepRetirals();\r\n                case 5:\r\n                    return new StepStockPurchase();\r\n                case 6:\r\n                    return new StepSummary();\r\n                default:\r\n                    throw new IllegalArgumentException(\"Unsupported position: \" + position);\r\n            }\r\n        }\r\n\r\nI am returning 7 in getCount() in my AbstractStepAdapter extension\r\n\r\nWhat I find funny is that the initial log print shows the following when the wizard is invoked. It should have ideally only printed upto position=6 and should have printed position=0 since we're now on the first step of the wizard when it is started. However, it prints position=1 as well when the stepper is now on the first step.\r\n\r\n2016-12-14 19:29:48:position=0\r\n2016-12-14 19:29:48:position=1\r\n2016-12-14 19:29:48:position=2\r\n2016-12-14 19:29:48:position=3\r\n2016-12-14 19:29:48:position=4\r\n2016-12-14 19:29:48:position=5\r\n2016-12-14 19:29:48:position=6\r\n2016-12-14 19:29:48:position=0\r\n2016-12-14 19:29:48:position=1\r\n\r\nBecause of this issue, when I move through the steps, I am getting wrong behavior since the step positions are now already incremented by 1 because of the behavior above. I am happy to paste the entire code if needed. This is frustrating and I don't know what I did wrong\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/stepstone-tech/android-material-stepper/issues/comments/267969389","html_url":"https://github.com/stepstone-tech/android-material-stepper/issues/35#issuecomment-267969389","issue_url":"https://api.github.com/repos/stepstone-tech/android-material-stepper/issues/35","id":267969389,"user":{"login":"zawadz88","id":3322260,"avatar_url":"https://avatars.githubusercontent.com/u/3322260?v=3","gravatar_id":"","url":"https://api.github.com/users/zawadz88","html_url":"https://github.com/zawadz88","followers_url":"https://api.github.com/users/zawadz88/followers","following_url":"https://api.github.com/users/zawadz88/following{/other_user}","gists_url":"https://api.github.com/users/zawadz88/gists{/gist_id}","starred_url":"https://api.github.com/users/zawadz88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zawadz88/subscriptions","organizations_url":"https://api.github.com/users/zawadz88/orgs","repos_url":"https://api.github.com/users/zawadz88/repos","events_url":"https://api.github.com/users/zawadz88/events{/privacy}","received_events_url":"https://api.github.com/users/zawadz88/received_events","type":"User","site_admin":false},"created_at":"2016-12-19T13:55:32Z","updated_at":"2016-12-19T13:55:32Z","body":"Hi @jagan999,\r\nI've discovered why we had a discrepancy. The behaviour you're describing is happening for the Material Stepper with tabs and I checked this this for the version with dots previously...\r\nAnyway, the _createStep_ method is used in _TabsStepperType_ in _onNewAdapter_ so that we can get the title of a tab.\r\nWhen I think about it now this is something that might get actually moved to the adapter itself.\r\n\r\nI am not sure though why this causing issues in your app. What exactly are you doing in _createStep_?"}}
{"actor":{"display_login":"zawadz88"}}