Posts

Showing posts with the label User Interface

Convert HTML / CSS From Adobe XD

Answer : Adobe XD has a plugin ecosystem where you can download a third-party built plugin to achieve tasks not supported by Adobe XD itself. For web export, I can recommend a plugin called "Web Export." In order to use the plugin, Make sure you have the latest version of XD Go to Plugins > Discover Plugins > Search "Web Export" Click "Install" Hope this helps! Natively, you can't (yet), although some external plugins can help you achieve that. Adobe XD is a prototyping tool, ie it has been designed for producing the designs of websites and app before passing it to a developer that will "manually" build the HTML/CSS/JS out of it. However, the export to HTML/CSS/JS feature has been asked before by the community many times and the Adobe team is currently working on it (check this and this).

Android M Light And Dark Status Bar Programmatically - How To Make It Dark Again?

Answer : The solution posted by @Aracem is valid but, doesn't work if you try change also the background color of the status bar. In my case I do it in the following way. To enable windowLightStatusBar(programatically,inside a Utils class for example): public static void setLightStatusBar(View view,Activity activity){ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { int flags = view.getSystemUiVisibility(); flags |= View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; view.setSystemUiVisibility(flags); activity.getWindow().setStatusBarColor(Color.WHITE); } } To restore to StatusBar to the previous state: public static void clearLightStatusBar(Activity activity) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { Window window = activity.getWindow(); window.setStatusBarColor(ContextCompat .getColor(activity,R.color.colorPrimaryDa...

Creating A Game Board With Tkinter

Answer : I created a board of labels and color them according to which is clicked: import Tkinter as tk board = [ [None]*10 for _ in range(10) ] counter = 0 root = tk.Tk() def on_click(i,j,event): global counter color = "red" if counter%2 else "black" event.widget.config(bg=color) board[i][j] = color counter += 1 for i,row in enumerate(board): for j,column in enumerate(row): L = tk.Label(root,text=' ',bg='grey') L.grid(row=i,column=j) L.bind('<Button-1>',lambda e,i=i,j=j: on_click(i,j,e)) root.mainloop() This doesn't do any validation (to make sure that the element clicked is at the bottom for example). It would also be much better with classes instead of global data, but that's an exercise for the interested coder :). You probably want to create a grid of Buttons. You can style them according to the values in board , and assign a callback that updates the board when clicke...