Open iljyya opened 7 years ago
public class MainActivity extends AppCompatActivity { private Drawable[] mDrawables = new Drawable[2]; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); View v = R.layout.activity_main; mDrawables[0] = v.getResources().getDrawable(R.drawable.ic_autorenew_white_24dp); mDrawables[1] = v.getResources().getDrawable(R.drawable.ic_done_white_24dp); final FloatingActionButton fab_line = (FloatingActionButton) findViewById(R.id.fab_line); fab_line.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { fab_line.setLineMorphingState((fab_line.getLineMorphingState() + 1) % 2, true); } }); } }
Click fab cannot change the drawable, what's wrong indeed? Layout , styles, states file is all fine, I think.
you need to add ThemeManager.init(this, 2, 0, null); at your application class . reference DemoApplication.java
Click fab cannot change the drawable, what's wrong indeed? Layout , styles, states file is all fine, I think.